Re: [PATCH v2 3/3] mm/khugepaged: release contended mmap read lock after scanning enough VMAs
From: Lorenzo Stoakes (ARM)
Date: Fri Nov 06 2026 - 05:59:23 EST
On Fri, Nov 06, 2026 at 05:38:27PM +0800, Baolin Wang wrote:
> > if (!collapse_possible_orders(vma, vma->vm_flags, TVA_KHUGEPAGED)) {
> > - /* Unable to collapse, skip to the next candidate. */
> > - mm_slot->address = ALIGN(vma->vm_end, HPAGE_PMD_SIZE);
> > + const unsigned long next =
> > + ALIGN(vma->vm_end, HPAGE_PMD_SIZE);
> > +
> > cc->progress++;
> > + /* Check for overflow. */
> > + if (unlikely(next < vma->vm_end)) {
> > + vma = NULL;
> > + break;
> > + }
> > + /* Unable to collapse, skip to the next candidate. */
> > + mm_slot->address = next;
> > continue;
> > }
>
> IMO, these changes seem to belong in patch 2?
You're right, will move them there on next respin, thanks!
--
Cheers, Lorenzo