Re: [PATCH] RCU safety for vma maple tree walks

From: Andi Kleen

Date: Mon Aug 31 2026 - 20:42:50 EST


> But none of this code uses RCU? I'm confused.

There are two classes of callers: ones that change the maple tree while
walking and those that don't. The ones that change it use
kfree_rcu (if that's what you meant with "use RCU") because they can free
nodes.

The patch changes both classes, but strictly only the ones actually
changing need the change. For the others the existing locking is
indeed sufficient.


> The maple tree state should not
> be keeping bad state. That is a bug.

It's more the iterators caching bad nodes, not the maple tree itself.

>
> All of these functions take the mmap write lock. That should exclude
> against other concurrent changes. Using RCU here makes no logical sense.

There's no concurrent changes, it's all local splits.

>
> Does the kernel say anything interesting when CONFIG_DEBUG_VM_MAPLE_TREE=y?

Was indeed missing. I'll try that.

-Andi