* [PATCH] mm: mglru: use pte_table_clamped_end() helper to calculate the end
@ 2026-11-12 11:12 Baolin Wang
0 siblings, 0 replies; only message in thread
From: Baolin Wang @ 2026-11-12 11:12 UTC (permalink / raw)
To: akpm, david, hannes, kasong
Cc: baohua, axelrasmussen, yuanchu, weixugc, baoquan.he, qi.zheng,
shakeel.butt, mhocko, baolin.wang, linux-mm, linux-kernel
Use pte_table_clamped_end() to clamp the range to the PTE table and VMA
boundaries when batch-checking young flags, making the code more readable.
No functional changes intended.
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
Based on mm/core.git for-next branch.
Note that this was found while reviewing David's series:
https://lore.kernel.org/all/c31cc8a0-c098-4784-a843-f13f51914094@linux.alibaba.com/
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5495d9be90e8..804d4188e7b4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4470,7 +4470,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw, unsigned int nr)
walk = current->reclaim_state ? current->reclaim_state->mm_walk : NULL;
start = max(addr & PMD_MASK, vma->vm_start);
- end = min(addr | ~PMD_MASK, vma->vm_end - 1) + 1;
+ end = pte_table_clamped_end(addr, vma->vm_end);
if (end - start == PAGE_SIZE)
return true;
--
2.47.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-12 11:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 11:12 [PATCH] mm: mglru: use pte_table_clamped_end() helper to calculate the end Baolin Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®