From: Mike Rapoport <rppt@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
linux-kernel@vger.kernel.org, Andy Lutomirski <luto@kernel.org>,
Borislav Petkov <bp@alien8.de>,
David Hildenbrand <david@kernel.org>,
Ingo Molnar <mingo@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>,
Juergen Gross <jgross@suse.com>,
Kevin Tian <kevin.tian@intel.com>,
Kiryl Shutsemau <kas@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Lorenzo Stoakes <ljs@kernel.org>,
Lu Baolu <baolu.lu@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Shakeel Butt <shakeel.butt@linux.dev>,
Suren Baghdasaryan <surenb@google.com>,
Thomas Gleixner <tglx@kernel.org>,
Toshi Kani <toshi.kani@hpe.com>,
Vlastimil Babka <vbabka@kernel.org>,
Will Deacon <will@kernel.org>,
linux-mm@kvack.org, x86@kernel.org
Subject: Re: [PATCH 3/3] x86/mm: Fix and document DEBUG_PAGEALLOC
Date: Thu, 30 Jul 2026 14:17:13 +0300 [thread overview]
Message-ID: <amsyuUq_JDh9k7J6@kernel.org> (raw)
In-Reply-To: <20260730104333.GE751831@noisy.programming.kicks-ass.net>
On Thu, Jul 30, 2026 at 12:43:33PM +0200, Peter Zijlstra wrote:
> 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.
In practice it's the same, either the thread that won the race for lock
updates the pte or just the first one to get to actual set_pte and it's
pretty random for overlapping regions anyway.
But I can see your point.
Anyway, we need Lorenzo's fixes from the set I sent [1] to protect against
other races and they conflict with your patches :(
If you are planning to send v2 maybe you can take them on top as well?
[1] https://lore.kernel.org/all/20260728-cpa-fixes-v1-0-2ed2352300b3@kernel.org
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2026-07-30 11:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 11:08 [PATCH 0/3] x86/mm: DEBUG_PAGEALLOC musings Peter Zijlstra
2026-07-29 11:08 ` [PATCH 1/3] x86/mm: Use guard() in cpa_collapse_large_pages() Peter Zijlstra
2026-07-29 11:08 ` [PATCH 2/3] x86/mm: Use guard() for pgd_lock Peter Zijlstra
2026-07-29 11:08 ` [PATCH 3/3] x86/mm: Fix and document DEBUG_PAGEALLOC Peter Zijlstra
2026-07-29 14:13 ` Mike Rapoport
2026-07-29 14:48 ` Peter Zijlstra
2026-07-29 19:07 ` Mike Rapoport
2026-07-30 10:43 ` Peter Zijlstra
2026-07-30 11:17 ` Mike Rapoport [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=amsyuUq_JDh9k7J6@kernel.org \
--to=rppt@kernel.org \
--cc=baolu.lu@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@kernel.org \
--cc=hpa@zytor.com \
--cc=jgg@ziepe.ca \
--cc=jgross@suse.com \
--cc=kas@kernel.org \
--cc=kevin.tian@intel.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=tglx@kernel.org \
--cc=toshi.kani@hpe.com \
--cc=vbabka@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox