Re: [PATCH v2 2/2] mm: Optimize mremap() by PTE batching
From: Lorenzo Stoakes
Date: Thu May 08 2025 - 05:41:36 EST
On Thu, May 08, 2025 at 12:46:41PM +0530, Anshuman Khandual wrote:
> On 5/7/25 11:32, Dev Jain wrote:
[snip]
> > +/* mremap a batch of PTEs mapping the same large folio */
> > +static int mremap_folio_pte_batch(struct vm_area_struct *vma, unsigned long addr,
> > + pte_t *ptep, pte_t pte, int max_nr)
> > +{
> > + const fpb_t flags = FPB_IGNORE_DIRTY | FPB_IGNORE_SOFT_DIRTY;
> > + struct folio *folio;
> > + int nr = 1;
>
> A small nit - s/nr/nr_pages ?
Agree in principal, but I think nr_ptes is clearer. You might not even be
dealing with a page, if you hit a pte_none() pte for instance.
So max_nr_ptes, nr_ptes.