Thread (14 messages) 14 messages, 2 authors, 2026-03-03

Re: [PATCH v2 5/6] mm: support batched checking of the young flag for MGLRU

From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-03-03 08:57:32
Also in: linux-mm, lkml

quoted
                 unsigned long pfn;
                 struct folio *folio;
-               pte_t ptent = ptep_get(pte + i);
+               pte_t ptent = ptep_get(pte);
  +               nr = 1;
                 total++;
                 walk->mm_stats[MM_LEAF_TOTAL]++;
  @@ -3533,7 +3534,16 @@ static bool walk_pte_range(pmd_t *pmd,
unsigned long start, unsigned long end,
                 if (!folio)
                         continue;
Thanks for the code. I considered simplifying the logic this way, but
this logic would be incorrect. Because the 'start' can be updated by the
get_next_vma() below, when we goto restart, we will get a new 'i' value
by 'pte_index(start)', so I kept the 'i' variable.
You're right, that's some horrible, horrible code.

-- 
Cheers,

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help