diff options
| author | Baolin Wang <[email protected]> | 2025-06-13 09:12:19 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-07-10 05:42:11 +0000 |
| commit | fa493f50df3adaddf9707d14b2f972ddd388f452 (patch) | |
| tree | a05245eccbda47f2193f61b150b68c7ca29f8408 /tools/testing/radix-tree/maple.c | |
| parent | selftest/mm: skip if fallocate() is unsupported in gup_longterm (diff) | |
| download | kernel-fa493f50df3adaddf9707d14b2f972ddd388f452.tar.gz kernel-fa493f50df3adaddf9707d14b2f972ddd388f452.zip | |
mm: huge_memory: fix the check for allowed huge orders in shmem
Shmem already supports mTHP, and shmem_allowable_huge_orders() will return
the huge orders allowed by shmem. However, there is no check against the
'orders' parameter passed by __thp_vma_allowable_orders(), which can lead
to incorrect check results for __thp_vma_allowable_orders().
For example, when a user wants to check if shmem supports PMD-sized THP by
thp_vma_allowable_order(), if shmem only enables 64K mTHP, the current
logic would cause thp_vma_allowable_order() to return true, implying that
shmem allows PMD-sized THP allocation, which it actually does not.
I don't think this will cause a significant impact on users, and this will
only have some impact on the shmem THP collapse. That is to say, even
though the shmem sysfs setting does not enable the PMD-sized THP, the
thp_vma_allowable_order() still indicates that shmem allows PMD-sized
collapse, meaning it might successfully collapse into THP, or it might not
(for example, thp_vma_suitable_order() check failed in the collapse
process). However, this still does not align with the shmem sysfs
configuration, fix it.
Link: https://lkml.kernel.org/r/529affb3220153d0d5a542960b535cdfc33f51d7.1749804835.git.baolin.wang@linux.alibaba.com
Fixes: 26c7d8413aaf ("mm: thp: support "THPeligible" semantics for mTHP with anonymous shmem")
Signed-off-by: Baolin Wang <[email protected]>
Reviewed-by: Lorenzo Stoakes <[email protected]>
Acked-by: Zi Yan <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Dev Jain <[email protected]>
Cc: Liam Howlett <[email protected]>
Cc: Mariano Pache <[email protected]>
Cc: Ryan Roberts <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/testing/radix-tree/maple.c')
0 files changed, 0 insertions, 0 deletions
