Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/huge_memory: remove enforce_sysfs from __thp_vma_allowable_orders

Using forced_collapse directly is clearer and enforce_sysfs is not really
needed.

Link: https://lkml.kernel.org/r/20250821150038.2025521-1-usamaarif642@gmail.com
Signed-off-by: Usama Arif <usamaarif642@gmail.com>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Mariano Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Usama Arif and committed by
Andrew Morton
32960f75 ce32123b

+3 -4
+3 -4
mm/huge_memory.c
··· 105 105 const bool smaps = type == TVA_SMAPS; 106 106 const bool in_pf = type == TVA_PAGEFAULT; 107 107 const bool forced_collapse = type == TVA_FORCED_COLLAPSE; 108 - const bool enforce_sysfs = !forced_collapse; 109 108 unsigned long supported_orders; 110 109 111 110 /* Check the intersection of requested and supported orders. */ ··· 167 168 if (!in_pf && shmem_file(vma->vm_file)) 168 169 return orders & shmem_allowable_huge_orders(file_inode(vma->vm_file), 169 170 vma, vma->vm_pgoff, 0, 170 - !enforce_sysfs); 171 + forced_collapse); 171 172 172 173 if (!vma_is_anonymous(vma)) { 173 174 /* 174 - * Enforce sysfs THP requirements as necessary. Anonymous vmas 175 + * Enforce THP collapse requirements as necessary. Anonymous vmas 175 176 * were already handled in thp_vma_allowable_orders(). 176 177 */ 177 - if (enforce_sysfs && 178 + if (!forced_collapse && 178 179 (!hugepage_global_enabled() || (!(vm_flags & VM_HUGEPAGE) && 179 180 !hugepage_global_always()))) 180 181 return 0;