From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Harry Yoo <harry@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>,
bpf@vger.kernel.org, andrii@kernel.org, eddyz87@gmail.com,
memxor@gmail.com, daniel@iogearbox.net,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
linux-rt-devel@lists.linux.dev,
Vlastimil Babka <vbabka@kernel.org>, Hao Li <hao.li@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <brendan.jackman@linux.dev>,
Johannes Weiner <hannes@cmpxchg.org>, Zi Yan <ziy@nvidia.com>,
linux-mm@kvack.org, Ingo Molnar <mingo@redhat.com>,
Will Deacon <will@kernel.org>, Boqun Feng <boqun@kernel.org>,
Waiman Long <longman@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v1 1/4] bpf: Add call for selecting kmalloc or kmalloc_nolock at call time
Date: Thu, 26 Nov 2026 10:46:15 +0100 [thread overview]
Message-ID: <aecebb39-47c9-4b0f-a076-ac0ddc7724d9@kernel.org> (raw)
In-Reply-To: <20261126094403.GA49833@noisy.programming.kicks-ass.net>
On 11/26/26 10:44, Peter Zijlstra wrote:
> On Thu, Nov 26, 2026 at 01:04:27AM +0000, Alexei Starovoitov wrote:
>> On Wed, Nov 25, 2026 at 06:09 AM Peter Zijlstra <peterz@infradead.org> wrote:
>>> This is absolute atrocious shite. You cannot attempt a spin_trylock from
>>> NMI context. That thing might be a mutex.
>>
>> cannot spin_trylock from NMI _on PREEMPT_RT_ ... correct.
>> And the patch guard against that.
>>
>> On RT the nolock path doesn't reach zone->lock in NMI or hardirq:
>>
>> __alloc_frozen_pages_noprof() alloc_flags has ALLOC_NOLOCK
>> alloc_nolock_allowed()
>> can_spin_trylock()
>> if (IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq()))
>> return false;
>>
>> fwiw kmalloc_nolock() has the same check.
>>
>>> This should not work; if it does, that is an accident we need to fix.
>>
>> It's not an accident.
>> In NMI only !RT SMP kernels reach the trylock.
>
> Allowing this on !RT makes people think this is 'OK' and then the RT
> people get to fix endless crap again :-(
>
> Locking constructs should behave identical across the configurations to
> avoid divergence and create problems.
>
> You're actively creating something that doesn't and cannot work on RT.
> That is not cool.
This is all just way too complicated and shaky, sorry to say it.
--
Cheers,
David
prev parent reply other threads:[~2026-11-26 9:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261124060357.11700-1-emil@etsalapatis.com>
[not found] ` <20261124060357.11700-2-emil@etsalapatis.com>
[not found] ` <DN38HGVL8JHQ.2ZVZQCKFXVA9T@gmail.com>
2026-11-24 13:59 ` Harry Yoo
2026-11-24 18:07 ` Emil Tsalapatis
2026-11-25 4:03 ` Alexei Starovoitov
2026-11-25 14:09 ` Peter Zijlstra
2026-11-25 14:30 ` Harry Yoo
2026-11-25 16:04 ` Peter Zijlstra
2026-11-26 1:07 ` Alexei Starovoitov
2026-11-26 1:04 ` Alexei Starovoitov
2026-11-26 9:44 ` Peter Zijlstra
2026-11-26 9:46 ` David Hildenbrand (Arm) [this message]
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=aecebb39-47c9-4b0f-a076-ac0ddc7724d9@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=boqun@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brendan.jackman@linux.dev \
--cc=clrkwllms@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=hannes@cmpxchg.org \
--cc=hao.li@linux.dev \
--cc=harry@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=longman@redhat.com \
--cc=memxor@gmail.com \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=will@kernel.org \
--cc=ziy@nvidia.com \
/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
all inboxes | Powered by JetHome®