From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F979C07E9D for ; Mon, 26 Sep 2022 16:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbiIZQmC (ORCPT ); Mon, 26 Sep 2022 12:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbiIZQlK (ORCPT ); Mon, 26 Sep 2022 12:41:10 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E160D7C1FF; Mon, 26 Sep 2022 08:28:46 -0700 (PDT) Date: Mon, 26 Sep 2022 17:28:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1664206125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9nbCVQlF5qlRYS1gBGpsvqLakPTcaKItqwHxbBmwhEU=; b=l95NVTonaPZeEOkZ4+Q4TZ1DUvKec7KYHg9OvC+2mNm8V/+3fUl03BoBAuEofGOTSLlJc1 OfkbknPRAo22h48R6SCkRodReH3PRKLd57V3qA7yb+cjo9/R0VAeKRaenrXttAFAXAK/Tf 53LtHBoqE4sDR5TR43tKMI8EX8r95ZovjCsfGJnfFUtogbr4hmgR3/GmEOTsMdU5MfqkPZ R0GcayhYMi+9lWM/FJX4mGS3UK0cvENZ0BuhejPpHlS4y40qtfXH8/sPpF+6NU+YDSnOgp tRbVNZO8OC+Ul6apcXmAoAb1zrdp2gGlJMV2MNZ4eVGjVp1oFlBIKO6ZWfRCXw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1664206125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9nbCVQlF5qlRYS1gBGpsvqLakPTcaKItqwHxbBmwhEU=; b=olKpBUea9DZ42RA47FqvYpgoEm5m73lP7JG6MFSQ5veDZbxevd8Nlr14YrjeQMjjL8v3DX ondOGzqBh1a9lyCw== From: Sebastian Andrzej Siewior To: Vlastimil Babka Cc: Uladzislau Rezki , Florian Westphal , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, Martin Zaharinov Subject: Re: [PATCH mm] mm: fix BUG with kvzalloc+GFP_ATOMIC Message-ID: References: <20220923103858.26729-1-fw@strlen.de> <20220923133512.GE22541@breakpoint.cc> <20220923145409.GF22541@breakpoint.cc> <76d0cb2b-a963-b867-4399-3e3c4828ecc4@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <76d0cb2b-a963-b867-4399-3e3c4828ecc4@suse.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-09-26 17:03:48 [+0200], Vlastimil Babka wrote: > > Doing the "p = kmalloc(sizeof(*p), GFP_ATOMIC);" from an atomic context > > is also a problem nowadays. Such code should be fixed across the kernel > > because of PREEMPT_RT support. You should make sure that the context in question is atomic on PREEMPT_RT before fixing it. My guess here is that it is average the softirq (NAPI) callback which is fine. > But the "atomic context" here is different, no? Calling kmalloc() from IRQ > handlers AFAIK is ok as IRQ handlers are threaded on PREEMPT_RT. Calling it > inside an local_irq_disable() would be a problem on the other hand. But then > under e.g. spin_lock_irqsave() could be ok as those don't really disable > irqs on RT. correct. Sebastian