[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250108233128.14484-11-npache@redhat.com>
Date: Wed, 8 Jan 2025 16:31:26 -0700
From: Nico Pache <npache@...hat.com>
To: linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Cc: ryan.roberts@....com,
anshuman.khandual@....com,
catalin.marinas@....com,
cl@...two.org,
vbabka@...e.cz,
mhocko@...e.com,
apopple@...dia.com,
dave.hansen@...ux.intel.com,
will@...nel.org,
baohua@...nel.org,
jack@...e.cz,
srivatsa@...il.mit.edu,
haowenchao22@...il.com,
hughd@...gle.com,
aneesh.kumar@...nel.org,
yang@...amperecomputing.com,
peterx@...hat.com,
ioworker0@...il.com,
wangkefeng.wang@...wei.com,
ziy@...dia.com,
jglisse@...gle.com,
surenb@...gle.com,
vishal.moola@...il.com,
zokeefe@...gle.com,
zhengqi.arch@...edance.com,
jhubbard@...dia.com,
21cnbao@...il.com,
willy@...radead.org,
kirill.shutemov@...ux.intel.com,
david@...hat.com,
aarcange@...hat.com,
raquini@...hat.com,
dev.jain@....com,
sunnanyong@...wei.com,
usamaarif642@...il.com,
audra@...hat.com,
akpm@...ux-foundation.org
Subject: [RFC 10/11] khugepaged: remove max_ptes_none restriction on the pmd scan
now that we have mTHP support, which uses max_ptes_none to determine how
"full" a mTHP size needs to collapse. lets remove the restriction during
the scan phase so we dont bailout early and miss potential mTHP
candidates.
Signed-off-by: Nico Pache <npache@...hat.com>
---
mm/khugepaged.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 4d3c560f20b4..61a349eb3cf4 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1446,15 +1446,12 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
if (pte_none(pteval) || is_zero_pfn(pte_pfn(pteval))) {
all_valid = false;
++none_or_zero;
- if (!userfaultfd_armed(vma) &&
- (!cc->is_khugepaged ||
- none_or_zero <= khugepaged_max_ptes_none)) {
- continue;
- } else {
+ if (userfaultfd_armed(vma)) {
result = SCAN_EXCEED_NONE_PTE;
count_vm_event(THP_SCAN_EXCEED_NONE_PTE);
goto out_unmap;
}
+ continue;
}
if (pte_uffd_wp(pteval)) {
/*
--
2.47.1
Powered by blists - more mailing lists