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

From: Peter Zijlstra

Date: Tue Apr 28 2026 - 08:03:29 EST


On Tue, Apr 28, 2026 at 10:58:41AM +0000, Dmitry Ilvokhin wrote:

> I re-tested my original patchset after rebasing and can still reproduce
> the regression (though smaller). It appears to depend on compiler
> inlining decisions: in some cases the compiler is able to deduplicate
> the cleanup path across multiple return sites, while in others it is
> not.

I'm confused, all this has __always_inline on. And the compilers should
be able to track the assignment of the variable and eliminate the test
themselves if value-tracking excludes NULL.

> Given that, I think we can go further than just removing
> __GUARD_IS_ERR(). It should be possible to eliminate this branch
> entirely and simplify the cleanup flow.
>
> https://lore.kernel.org/all/20260427165037.205337-1-d@xxxxxxxxxxxx/
>
> Reposting here to increase visibility, as several people involved in
> this code have participated in this thread already.
>
> Any feedback would be appreciated.

This would require very careful audit of all the current users, it's had
this behaviour from the start.