Re: [PATCH] mm: prepare anon_vma before swapin rmap

From: Lorenzo Stoakes

Date: Sat Apr 18 2026 - 05:35:54 EST


On Fri, Apr 17, 2026 at 01:57:59PM +0200, David Hildenbrand (Arm) wrote:
> Maybe there was a scenario where we could have lost vma->anon_vma during
> a merge, resulting in a swapped page in an anon_vma.

Unless there's a bug (and correct me if I'm misinterpreting), VMA merge requires
vma->anon_vma to either be equal for merged adjacent VMAs, or one or the other
VMA to have NULL vma->anon_vma, in which case we set vma->anon_vma in the merged
VMA.

Thanks, Lorenzo