From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs: disable bs > ps support if no transparent hugepage support
Date: Thu, 30 Jul 2026 16:37:39 +0930 [thread overview]
Message-ID: <7a79cac71ca43f63cdcf21ee9bba95be05f16230.1785395252.git.wqu@suse.com> (raw)
Btrfs relies one mapping_set_folio_order_range() to set the minimal
folio order for all its data inodes, but that function will be nop if
transparent hugepage is not enabled.
Guard the bs > ps support behind CONFIG_TRANSPARENT_HUGEPAGE, just like
all other filesystems.
Fixes: 98077f7f2180 ("btrfs: enable experimental bs > ps support")
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/Kconfig | 3 ++-
fs/btrfs/fs.c | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index 9de04c37e11a..4b10d78ed99b 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -106,7 +106,8 @@ config BTRFS_EXPERIMENTAL
- extent tree v2 - complex rework of extent tracking
- - block size > page size support
+ - block size > page size support - needs transparent huge page and
+ non-HIGHMEM system
- huge folios for data - folios can be as large as 2MiB now
diff --git a/fs/btrfs/fs.c b/fs/btrfs/fs.c
index 5015d0148841..77544ee5e6db 100644
--- a/fs/btrfs/fs.c
+++ b/fs/btrfs/fs.c
@@ -155,8 +155,12 @@ bool __attribute_const__ btrfs_supported_blocksize(u32 blocksize)
*
* Considering HIGHMEM is such a pain to deal with and it's going
* to be deprecated eventually, just reject HIGHMEM && bs > ps cases.
+ *
+ * Finally, for bs > ps cases, we need to set the minimal folio order,
+ * which requires transparent hugepage.
*/
- if (IS_ENABLED(CONFIG_HIGHMEM) && blocksize > PAGE_SIZE)
+ if (blocksize > PAGE_SIZE &&
+ (IS_ENABLED(CONFIG_HIGHMEM) || !IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)))
return false;
return true;
#endif
--
2.54.0
next reply other threads:[~2026-07-30 7:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 7:07 Qu Wenruo [this message]
2026-07-30 15:53 ` [PATCH] btrfs: disable bs > ps support if no transparent hugepage support Filipe Manana
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=7a79cac71ca43f63cdcf21ee9bba95be05f16230.1785395252.git.wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@vger.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