Re: [PATCH v2 2/2] mm: shmem: disallow hugepages if the system-wide shmem THP sysfs settings are disabled

From: Baolin Wang
Date: Mon Jun 09 2025 - 02:34:39 EST




On 2025/6/7 20:17, Lorenzo Stoakes wrote:
On Sat, Jun 07, 2025 at 01:14:41PM +0100, Lorenzo Stoakes wrote:
On Thu, Jun 05, 2025 at 04:00:59PM +0800, Baolin Wang wrote:
[snip]

Another rule for madvise, referring to David's suggestion: “allowing for collapsing
in a VM without VM_HUGEPAGE in the "madvise" mode would be fine".

Hm I'm not sure if this is enforced is it? I may have missed something here
however.

Oh right actually I think it is implicitly - if TVA_ENFORCE_SYSFS is not
specified in tva_flags, then we don't bother applying an madvise filter at all
anyway, and we account for that in our 'enabled' check in
thp_vma_allowable_orders().

But I don't think this patch changes anything, I actually _think_ we can just
drop this one.

See my previous replies. Shmem mTHP sysfs settings are different from Anonymous pages.

Thanks for reviewing.