Re: [PATCH] docs: update THP documentation to clarify sysfs "never" setting
From: Lorenzo Stoakes
Date: Wed Jul 23 2025 - 11:42:41 EST
On Tue, Jul 22, 2025 at 06:29:15AM +0100, Lorenzo Stoakes wrote:
> Re: man page - I _do_ intend to update the man page as I find it far too
> vague on this topic currently, so that patch will be coming soon.
Actually:
MADV_COLLAPSE is independent of any sysfs (see sysfs(5))
setting under /sys/kernel/mm/transparent_hugepage, both in
terms of determining THP eligibility, and allocation
semantics. See Linux kernel source file
Documentation/admin-guide/mm/transhuge.rst for more
information. MADV_COLLAPSE also ignores huge= tmpfs mount
when operating on tmpfs files. Allocation for the new
hugepage may enter direct reclaim and/or compaction,
regardless of VMA flags (though VM_NOHUGEPAGE is still
respected).
I think this is clear enough to require no update.
THe confusion arose from the doc page seemingly contradicting this. By
referring to the doc page which now makes things clear, we're all good! :)
Cheers, Lorenzo