Re: [PATCH 1/8] mm: use zone lock guard in reserve_highatomic_pageblock()

From: Steven Rostedt

Date: Fri Mar 06 2026 - 13:01:09 EST



[ Adding Peter ]

On Fri, 6 Mar 2026 09:53:36 -0800
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, 6 Mar 2026 16:05:35 +0000 Dmitry Ilvokhin <d@xxxxxxxxxxxx> wrote:
>
> > Use the newly introduced zone_lock_irqsave lock guard in
> > reserve_highatomic_pageblock() to replace the explicit lock/unlock and
> > goto out_unlock pattern with automatic scope-based cleanup.
> >
> > ...
> >
> > - zone_lock_irqsave(zone, flags);
> > + guard(zone_lock_irqsave)(zone);
>
> guard() is cute, but this patch adds a little overhead - defconfig
> page_alloc.o text increases by 32 bytes, presumably all in
> reserve_highatomic_pageblock(). More instructions, larger cache
> footprint.
>
> So we're adding a little overhead to every user's Linux machine for all
> time. In return for which the developers get a little convenience and
> maintainability.

I think maintainability is of importance. Is there any measurable slowdown?
Or are we only worried about the text size increase?

>
> Is it worth it?

This is being done all over the kernel. Perhaps we should look at ways to
make the generic infrastructure more performant?

-- Steve