From: Jann Horn <jannh@google.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Vitaly Chikunov <vt@altlinux.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
stable@vger.kernel.org
Subject: Re: [PATCH] x86/mm: Disable hugetlb page table sharing on non-PAE 32-bit
Date: Tue, 1 Jul 2025 12:33:46 +0200 [thread overview]
Message-ID: <CAG48ez3YcgPz+oQ4shMjaviPNeZjJYg8K3iDPJkLaOKbcgASNw@mail.gmail.com> (raw)
In-Reply-To: <9179e1cd-d635-4e70-931e-4a85c2e6932b@intel.com>
On Mon, Jun 30, 2025 at 10:39 PM Dave Hansen <dave.hansen@intel.com> wrote:
> On 6/30/25 12:07, Jann Horn wrote:
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -147,7 +147,7 @@ config X86
> > select ARCH_WANTS_DYNAMIC_TASK_STRUCT
> > select ARCH_WANTS_NO_INSTR
> > select ARCH_WANT_GENERAL_HUGETLB
> > - select ARCH_WANT_HUGE_PMD_SHARE
> > + select ARCH_WANT_HUGE_PMD_SHARE if PGTABLE_LEVELS > 2
> > select ARCH_WANT_LD_ORPHAN_WARN
> > select ARCH_WANT_OPTIMIZE_DAX_VMEMMAP if X86_64
> > select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP if X86_64
>
> Does pmd sharing really even work on 32-bit? Just practically, you only
> ever have 3GB of address space and thus 3 possible PGDs that can be used
> for sharing (with the 3:1 split configured). You presumably need *some*
> address space for the binary to even execve(). The vdso and friends go
> somewhere and we normally don't let anything get mapped at 0x0.
>
> I think that leaves _maybe_ one slot.
>
> Barring something some specific and compelling actual use case, this
> should probably just be:
>
> select ARCH_WANT_HUGE_PMD_SHARE if X86_64
Yeah, makes sense. I was also thinking that it would be more
reasonable to restrict this to 64-bit only, but figured it would be
less risky to make this more specific change.
But now that I think about it, it's not like stuff is actually going
to break from this change, worst case the kernel memory usage goes up
a bunch in a very unlikely configuration... so yeah, I guess I'll
resend this later with "if X86-64".
prev parent reply other threads:[~2025-07-01 10:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 19:07 Jann Horn
2025-06-30 20:23 ` Vitaly Chikunov
2025-06-30 20:39 ` Dave Hansen
2025-07-01 10:33 ` Jann Horn [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=CAG48ez3YcgPz+oQ4shMjaviPNeZjJYg8K3iDPJkLaOKbcgASNw@mail.gmail.com \
--to=jannh@google.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=vt@altlinux.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