Re: [RFC PATCH 1/2] procfs: add contpte info into smaps
From: David Hildenbrand (Arm)
Date: Wed Apr 15 2026 - 08:53:38 EST
> +#ifndef pte_cont
> +#define pte_cont(pte) (false)
> +#endif
> +
> static void smaps_pte_entry(pte_t *pte, unsigned long addr,
> struct mm_walk *walk)
> {
> @@ -1023,12 +1030,14 @@ static void smaps_pte_entry(pte_t *pte, unsigned long addr,
> bool locked = !!(vma->vm_flags & VM_LOCKED);
> struct page *page = NULL;
> bool present = false, young = false, dirty = false;
> + bool cont = false;
> pte_t ptent = ptep_get(pte);
>
> if (pte_present(ptent)) {
> page = vm_normal_page(vma, addr, ptent);
> young = pte_young(ptent);
> dirty = pte_dirty(ptent);
> + cont = pte_cont(ptent);
No, none of this low-level pte_cont fiddling in common code.
We have folio_pte_batch() to batch over folio ptes. And we want some
better page table walkers to just do the batching for us:
https://lore.kernel.org/r/20260412174244.133715-1-osalvador@xxxxxxx
--
Cheers,
David