Linux filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: willy@infradead.org, jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: what is the correct hugepage dependency for large pagecache folios
Date: Wed, 25 Nov 2026 09:43:00 +0100	[thread overview]
Message-ID: <20261125084300.GA23551@lst.de> (raw)

Hi all,

we ran into an interesting cluster of issues with an LLM review for
the (not upstream submitted yet but public) xraid code.

The LLM complained that largest_zero_folio might only return a
PAGE_SIZE zero folio, and this can happen because either:

 - CONFIG_TRANSPARENT_HUGEPAGE is enabled by has_transparent_hugepage
   returns false
 - huge_zero_init can fail to allocate a PMD-sized huge folio even
   when transparent huge pages are supported and
   CONFIG_PERSISTENT_HUGE_ZERO_FOLIO is selected

This boils down to three interesting questions:

 1) should mapping_max_folio_size_supported check has_transparent_hugepage
    instead of CONFIG_TRANSPARENT_HUGEPAGE, or do all the required bits
    for large folios in the page work fine even if there is no hardware
    support for PMD-level or other mappings?
 2) should huge_zero_init aim to allocate a large zero folio even
    when has_transparent_hugepage returns true so that file systems
    can assume to have a file system-block sized zero folio?
 3) should we fail to boot if the allocation in huge_zero_init
    fails?

Note that only 1) really applies to the current upstream kernel as both
current users of largest_zero_folio can fall back to building bios
with multiple segments of zero_page, but for some of my pending code
that won't be as easy, so if we can't actually reliably get a common
zero folio of mapping_max_folio_size_supported we might have to allocate
a duplicate one in fs code.

                 reply	other threads:[~2026-11-25  8:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261125084300.GA23551@lst.de \
    --to=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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