Re: [PATCH] mm/page_alloc: let the bulk and folio allocators carry alloc_flags

From: Gregory Price

Date: Wed Sep 23 2026 - 11:48:24 EST


On Wed, Sep 23, 2026 at 08:32:29AM +0200, Vlastimil Babka (SUSE) wrote:
> On 9/23/26 03:59, Gregory Price wrote:
> > On Tue, Sep 22, 2026 at 09:05:58PM +0800, Lance Yang wrote:
> >
> > There is some concern around NOLOCK here yes, in fact sashiko picked
> > this issue up and I've been poking at it.
>
> It's possible to document it as unsupported, add a VM_WARN_ON_ONCE etc.
> It's not necessary for bulk alloc to support ALLOC_NOLOCK just because it
> takes flags. e.g. kmalloc_nolock() supports a subset of gfp flags as well.
>

It seemed simpler to just support it than to create more future
footguns. I can RFC my current rework if you like, i attempted
to deduplicate the logic via a prepare_alloc_flags() called from
both the bulk and non-bulk contexts.

But if we prefer the WARNs over adding the new semantics to the bulk
allocator, that also doesn't seem unreasonable.

~Gregory