Re: [RFC v2 1/3] filemap: set max order to be min order if THP is disabled

From: Hannes Reinecke
Date: Tue Dec 09 2025 - 19:40:09 EST


On 12/9/25 17:33, Pankaj Raghav wrote:
On 12/9/25 13:15, Hannes Reinecke wrote:
On 12/6/25 04:08, Pankaj Raghav wrote:
Large folios in the page cache depend on the splitting infrastructure from
THP. To remove the dependency between large folios and
CONFIG_TRANSPARENT_HUGEPAGE, set the min order == max order if THP is
disabled. This will make sure the splitting code will not be required
when THP is disabled, therefore, removing the dependency between large
folios and THP.

The description is actually misleading.
It's not that you remove the dependency from THP for large folios
_in general_ (the CONFIG_THP is retained in this patch).
Rather you remove the dependency for large folios _for the block layer_.
And that should be make explicit in the description, otherwise the
description and the patch doesn't match.


Hmm, that is not what I am doing. This has nothing to do with the block layer directly.
I mentioned this in the cover letter but I can reiterate it again.

Large folios depended on THP infrastructure when it was introduced. When we added added LBS support
to the block layer, we introduced an indirect dependency on CONFIG_THP. When we disabled config_THP
and had a block device logical block size > page size, we ran into a panic.

That was fixed here[1].

Yes, and no. That patch limited the maximum blocksize without THP to 4k,
so effectively disabling LBS.

If this patch is upstreamed, then we can disable THP but still have a LBS drive attached without any
issues.

But this is what I meant. We do _not_ disable the dependency on THP for
LBS, we just remove checks for the config option itself in the block layer code. The actual dependency on THP will remain as LBS will only
be supported if THP is enabled.

Baolin added another CONFIG_THP block in ext4 [2]. With this support, we don't need to sprinkle THP
where file backed large folios are used.

Happy to discuss this in LPC (if you are attending)!

The very first presentation on the first day in the CXL track. Yes :-)
Let's discuss there; would love to figure out if we cannot remove the
actual dependency on THP, too.

Cheers,

Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich