From: Dave Hansen <dave.hansen@intel.com>
To: "Denis V. Lunev" <den@openvz.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
x86@kernel.org
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
Juergen Gross <jgross@suse.com>, Kiryl Shutsemau <kas@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm/pat: take cpa_lock around large-page collapse
Date: Fri, 10 Jul 2026 10:13:21 -0700 [thread overview]
Message-ID: <aab44f08-89f8-47fe-bee4-0ab6b25968c6@intel.com> (raw)
In-Reply-To: <20260626163213.2284080-1-den@openvz.org>
On 6/26/26 09:32, Denis V. Lunev wrote:
> + /*
> + * debug_pagealloc bypasses cpa_lock, so __change_page_attr() walks
> + * unserialized and freeing collapsed PTE-tables could race it; skip
> + * the optional merge there.
> + */
> + if (debug_pagealloc_enabled())
> + return;
Wow, that debug_pagealloc hack is ancient and came with the original
introduction of cpa_lock:
> commit ad5ca55f6bdb47c957b681c7358bb3719ba4ee82
> Author: Suresh Siddha <suresh.b.siddha@intel.com>
> Date: Tue Sep 23 14:00:42 2008 -0700
>
> x86, cpa: srlz cpa(), global flush tlb after splitting big page and before doing cpa
My only question is *why*!?!? Why add extra locking complexity and rules
to optimize debug_pagealloc, which is already horrendously slow.
I kinda think we should just _remove_ the locking which is conditional
on debug_pagealloc_enabled().
next prev parent reply other threads:[~2026-07-10 17:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 16:32 [PATCH] x86/mm/pat: take cpa_lock around large-page collapse Denis V. Lunev
2026-07-02 17:47 ` Denis V. Lunev
2026-07-03 13:01 ` Kiryl Shutsemau
2026-07-10 16:15 ` Denis V. Lunev
2026-07-10 17:15 ` Dave Hansen
2026-07-11 8:47 ` Mike Rapoport
2026-07-10 17:13 ` Dave Hansen [this message]
2026-07-11 8:56 ` Mike Rapoport
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=aab44f08-89f8-47fe-bee4-0ab6b25968c6@intel.com \
--to=dave.hansen@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=den@openvz.org \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=kas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rppt@kernel.org \
--cc=tglx@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