From: "David Hildenbrand (Arm)" <david@kernel.org>
To: WANG Rui <r@hev.cc>, Alexander Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Barry Song <baohua@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Dev Jain <dev.jain@arm.com>, Jan Kara <jack@suse.cz>,
Kees Cook <kees@kernel.org>, Lance Yang <lance.yang@linux.dev>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Matthew Wilcox <willy@infradead.org>,
Nico Pache <npache@redhat.com>,
Ryan Roberts <ryan.roberts@arm.com>, Zi Yan <ziy@nvidia.com>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/2] huge_mm: add stubs for THP-disabled configs
Date: Thu, 12 Mar 2026 16:53:14 +0100 [thread overview]
Message-ID: <bca4ea00-3052-425b-8f39-729d504fd4db@kernel.org> (raw)
In-Reply-To: <20260310031138.509730-2-r@hev.cc>
On 3/10/26 04:11, WANG Rui wrote:
> hugepage_global_enabled() and hugepage_global_always() only exist
> when CONFIG_TRANSPARENT_HUGEPAGE is set. Add inline stubs that
> return false to let code compile when THP is disabled.
>
> Signed-off-by: WANG Rui <r@hev.cc>
> ---
> include/linux/huge_mm.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
> index a4d9f964dfde..badeebd4ea98 100644
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -570,6 +570,16 @@ void map_anon_folio_pmd_nopf(struct folio *folio, pmd_t *pmd,
>
> #else /* CONFIG_TRANSPARENT_HUGEPAGE */
>
> +static inline bool hugepage_global_enabled(void)
> +{
> + return false;
> +}
> +
> +static inline bool hugepage_global_always(void)
> +{
> + return false;
> +}
> +
> static inline bool folio_test_pmd_mappable(struct folio *folio)
> {
> return false;
There are other ways to enable PMD THP. So I don't quite think this is
the right tool for the job.
--
Cheers,
David
next prev parent reply other threads:[~2026-03-12 15:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 3:11 [PATCH v4 0/2] binfmt_elf: Align eligible read-only PT_LOAD segments to PMD_SIZE for THP WANG Rui
2026-03-10 3:11 ` [PATCH v4 1/2] huge_mm: add stubs for THP-disabled configs WANG Rui
2026-03-12 15:53 ` David Hildenbrand (Arm) [this message]
2026-03-12 15:57 ` David Hildenbrand (Arm)
2026-03-12 16:12 ` hev
2026-03-12 16:29 ` David Hildenbrand (Arm)
2026-03-13 0:10 ` hev
2026-03-13 9:47 ` Lance Yang
2026-03-10 3:11 ` [PATCH v4 2/2] binfmt_elf: Align eligible read-only PT_LOAD segments to PMD_SIZE for THP WANG Rui
2026-03-13 8:41 ` [PATCH v4 0/2] " Baolin Wang
2026-03-13 10:46 ` Usama Arif
2026-03-13 14:39 ` hev
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=bca4ea00-3052-425b-8f39-729d504fd4db@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=brauner@kernel.org \
--cc=dev.jain@arm.com \
--cc=jack@suse.cz \
--cc=kees@kernel.org \
--cc=lance.yang@linux.dev \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=npache@redhat.com \
--cc=r@hev.cc \
--cc=ryan.roberts@arm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/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