Re: [PATCH 3/3] x86/mm: Fix and document DEBUG_PAGEALLOC
From: Peter Zijlstra
Date: Thu Jul 30 2026 - 06:52:42 EST
On Wed, Jul 29, 2026 at 10:07:27PM +0300, Mike Rapoport wrote:
> > > I like my version with your comments added there more as it localizes the
> > > DEBUG_PAGEALLOC exception in the lock wrappers.
> >
> > So I don't like removing cpa_lock entirely; it is still serializing cpa
>
> I meant static inline cpa_lock(), not removing it entirely.
> With your comment why DEBUG_PAGEALLOC is special.
That is, I despise the whole:
if (!debug_pagealloc_enabled())
spin_lock(&cpa_lock);
with a passion. It blanked kills cpa_lock as whole and changes the rules
for everyone when debug_pagealloc is on.
cpa_lock ensures that concurrent cpa() calls on an overlapping region
have a well defined outcome. By removing it entirely you can get random
state.
In practise this isn't likely to matter, but relaxing this for a debug
option is insane. Debug stuff should tighten rules, not relax them.