Re: [PATCH v2] mm/vma: don't remove VMA from rmap if pgoff unchanged

From: Lance Yang

Date: Fri Oct 02 2026 - 10:19:19 EST




On 2026/10/2 22:05, Lorenzo Stoakes (ARM) wrote:
On Thu, Oct 01, 2026 at 11:45:11PM +0800, Lance Yang wrote:
[...]
+static void anon_rmap_tree_update_inplace(struct anon_vma_chain *avc)
+{
+#ifdef CONFIG_DEBUG_VM_RB
+ avc->cached_vma_last = avc_last_pgoff(avc);
+#endif
+ /* Propagate all the way up the tree. */

Nit: propagate() can stop early when rb_subtree_last is unchanged ...

Maybe:

/* Update the subtree maximum and propagate any changes up the tree. */

I think in this case it's ok to be a bit blurry about it :P it deciding not to
unnecessary work is fine but I don't want to put too much in there.

The point is as a simple sign or pointer to help somebody wondering wtf that's
for even if it's not quite the full story!

Hopefully that's ok? :)

Fair enough. Let’s leave it as-is ;)



+ __anon_rmap_tree_augment.propagate(&avc->rb, NULL);
+}
+
[...]

Acked-by: Lance Yang <lance.yang@xxxxxxxxx>

Thanks :)


Hammered it with VMA churn (split/merge/mremap/madvise/fork) + concurrent
rmap walks + hwpoison injection. Nothing complained :D

Tested-by: Lance Yang <lance.yang@xxxxxxxxx>

Thanks, very much appreciated! :)

Cheers!