Re: [PATCH] mm/vma: don't remove VMA from rmap if pgoff unchanged
From: Rik van Riel
Date: Fri Sep 25 2026 - 15:03:47 EST
On Fri, 2026-09-25 at 19:32 +0100, Lorenzo Stoakes (ARM) wrote:
>
> When performing a VMA shrink or a split where the VMA is the lower
> one, the
> page offset cannot change, so set the flags unconditionally in these
> cases.
>
> When merging VMAs the page offset is unchanged only in some cases, so
> update init_multi_vma_prep() to set the flags only if the page
> offsets
> remain the same.
>
> These changes ultimately result in less rmap lock contention.
>
> Reported-by: Pan Deng <pan.deng@xxxxxxxxx>
> Closes:
> https://lore.kernel.org/linux-mm/20260924054301.2330822-1-pan.deng@xxxxxxxxx/
> Signed-off-by: Lorenzo Stoakes <ljs@xxxxxxxxxx>
Nice optimization.
Reviewed-by: Rik van Riel <riel@xxxxxxxxxxx>
--
All Rights Reversed.