[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DEZK5U2YP6I0.27VJHSVK14646@google.com>
Date: Tue, 16 Dec 2025 10:10:46 +0000
From: Brendan Jackman <jackmanb@...gle.com>
To: Yeoreum Yun <yeoreum.yun@....com>, Brendan Jackman <jackmanb@...gle.com>
Cc: <akpm@...ux-foundation.org>, <david@...nel.org>,
<lorenzo.stoakes@...cle.com>, <Liam.Howlett@...cle.com>, <vbabka@...e.cz>,
<rppt@...nel.org>, <surenb@...gle.com>, <mhocko@...e.com>, <ast@...nel.org>,
<daniel@...earbox.net>, <andrii@...nel.org>, <martin.lau@...ux.dev>,
<eddyz87@...il.com>, <song@...nel.org>, <yonghong.song@...ux.dev>,
<john.fastabend@...il.com>, <kpsingh@...nel.org>, <sdf@...ichev.me>,
<haoluo@...gle.com>, <jolsa@...nel.org>, <hannes@...xchg.org>,
<ziy@...dia.com>, <bigeasy@...utronix.de>, <clrkwllms@...nel.org>,
<rostedt@...dmis.org>, <catalin.marinas@....com>, <will@...nel.org>,
<ryan.roberts@....com>, <kevin.brodsky@....com>, <dev.jain@....com>,
<yang@...amperecomputing.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <bpf@...r.kernel.org>,
<linux-rt-devel@...ts.linux.dev>, <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 2/2] arm64: mmu: use pagetable_alloc_nolock() while stop_machine()
On Mon Dec 15, 2025 at 10:06 AM UTC, Yeoreum Yun wrote:
[snip]
>> Overall I am feeling a bit uncomfortable about this use of _nolock, but
>> I am also feeling pretty ignorant about PREEMPT_RT and also about this
>> arm64 code, so I am hesitant to suggest alternatives, I hope someone
>> else can offer some input here...
>
> I understand. However, as I mentioned earlier,
> my main intention was to hear opinions specifically about memory contention.
>
> That said, if there is no memory contention,
> I don’t think using the _nolock API is necessarily a bad approach.
> In fact, I believe a bigger issue is that, under PREEMPT_RT,
> code that uses the regular memory allocation APIs may give users the false impression
> that those APIs are “safe to use,” even though they are not.
Yeah, I share this concern. I would bet I have written code that's
broken under PREEMPT_RT (luckily only in Google's kernel fork). The
comment for GFP_ATOMIC says:
* %GFP_ATOMIC users can not sleep and need the allocation to succeed. A lower
* watermark is applied to allow access to "atomic reserves".
* The current implementation doesn't support NMI and few other strict
* non-preemptive contexts (e.g. raw_spin_lock). The same applies to %GFP_NOWAIT.
It kinda sounds like it's supposed to be OK to use GFP_ATOMIC in a
normal preempt_disable() context. So do you know exactly why it's
invalid to use it in this stop_machine() context here? Maybe we need to
update this comment. Or, maybe actually we need to fix the allocator so
that GFP_ATOMIC allocs are safe in this context?
Powered by blists - more mailing lists