Re: [PATCH v2 8/8] mm/rmap: batch unmap anonymous swap-backed large folios

From: Barry Song

Date: Thu Sep 10 2026 - 00:58:56 EST


On Thu, Sep 10, 2026 at 12:39 PM Dev Jain <dev.jain@xxxxxxx> wrote:
[...]
> >> +static bool ttu_anon_swapbacked_folio(struct vm_area_struct *vma,
> >> + struct folio *folio, struct page *first_page,
> >> + unsigned long address, pte_t *ptep, pte_t pteval,
> >> + unsigned long nr_pages)
> >> +{
> >> + unsigned long batch_idx = 0;
> >> +
> >> + while (nr_pages) {
> >> + bool anon_exclusive = PageAnonExclusive(first_page + batch_idx);
> >> + unsigned long len = page_anon_exclusive_batch(batch_idx,
> >> + nr_pages, first_page, anon_exclusive);
> >
> > `len` is really a bad name, as `len` usually describes a size.
> > Maybe `batch_pages`?
>
> I disagree here : ) I don't think someone should mistake len with size.
> len is ... "length". So in this case it is the length of pages in the
> array, starting from batch_idx, upto nr_pages, which are all exclusive
> or not. Also I would prefer short variable names.

OK, up to you :-)