netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Uladzislau Rezki <urezki@gmail.com>,
	Florian Westphal <fw@strlen.de>, Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org,
	Martin Zaharinov <micron10@gmail.com>
Subject: Re: [PATCH mm] mm: fix BUG with kvzalloc+GFP_ATOMIC
Date: Mon, 26 Sep 2022 17:28:43 +0200	[thread overview]
Message-ID: <YzHFK01dNy5dKJDO@linutronix.de> (raw)
In-Reply-To: <76d0cb2b-a963-b867-4399-3e3c4828ecc4@suse.cz>

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

  reply	other threads:[~2022-09-26 16:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 10:38 [PATCH mm] mm: fix BUG with kvzalloc+GFP_ATOMIC Florian Westphal
2022-09-23 13:29 ` Michal Hocko
2022-09-23 13:35   ` Florian Westphal
2022-09-23 14:43     ` Uladzislau Rezki
2022-09-23 14:54       ` Florian Westphal
2022-09-23 15:10         ` Uladzislau Rezki
2022-09-26 15:03           ` Vlastimil Babka
2022-09-26 15:28             ` Sebastian Andrzej Siewior [this message]
2022-09-26  7:49     ` Michal Hocko
2022-09-26  7:56       ` Florian Westphal
2022-09-26  8:57         ` Michal Hocko
2022-09-26  9:30           ` Michal Hocko
2022-09-26 10:08             ` Florian Westphal
2022-09-26 12:02               ` Michal Hocko
2022-09-26 13:08                 ` Florian Westphal
2022-09-26 13:38                   ` Florian Westphal
2022-09-26 14:05                   ` Michal Hocko
2022-09-26 14:20                     ` Florian Westphal
2022-09-26 14:32                       ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YzHFK01dNy5dKJDO@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=fw@strlen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=micron10@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).