[PATCH v2 03/19] maple_tree: Add write lock checking with lockdep sequence numbers

Liam R. Howlett (Oracle) liam at infradead.org
Mon Jul 20 07:03:51 PDT 2026


On 26/07/08 08:44AM, Breno Leitao wrote:
> Hello Liam,

Hello!

> 
> On Tue, Jun 30, 2026 at 03:08:27PM -0400, Liam R. Howlett (Oracle) wrote:
> > +#ifdef CONFIG_RCU_STRICT_GRACE_PERIOD
> >  	if (!mt_locked(mas->tree)) {
> >  		if (mt_in_rcu(mas->tree))
> >  			WARN_ON_ONCE(poll_state_synchronize_rcu(mas->rcu_gp));
> 
> Testing next-20260706 on arm64 under a stress-ng + fork/exit/mprotect workload,
> I'm hitting the new maple_tree write-lock sequence check:
> 
>     WARNING: lib/maple_tree.c:1188 at mas_store_prealloc+0x2a8/0xac0

No, this is not expected and I didn't know about it.  Does it still
happen in next?  I'll start looking at this while I wait to hear from
your side.

> 
> It fires from several core mm paths — fork (dup_mmap), exit (exit_mmap),
> and mprotect (__split_vma) — across multiple processes. The two cleanest
> traces are both in the mprotect path:
> 
>     WARNING: lib/maple_tree.c:1188 at mas_store_prealloc+0x2a8/0xac0, CPU#67
>     Call trace:
>      mas_store_prealloc+0x2a8/0xac0 (P)
>      vma_iter_store_new+0x2b4/0x3c8
>      vma_complete+0x258/0x7c0
>      __split_vma+0x64c/0x770
>      vma_modify+0x11fc/0x1808
>      vma_modify_flags+0x18c/0x220
>      mprotect_fixup+0x22c/0x4e8
>      do_mprotect_pkey+0x558/0x720
>      __arm64_sys_mprotect+0x88/0xa8
> 
>     WARNING: lib/maple_tree.c:1188 at mas_prev+0x160/0x1a8, CPU#67
>     Call trace:
>      mas_prev+0x160/0x1a8 (P)
>      __split_vma+0x658/0x770
>      vma_modify+0x11fc/0x1808
>      vma_modify_flags+0x18c/0x220
>      mprotect_fixup+0x22c/0x4e8
>      do_mprotect_pkey+0x558/0x720
>      __arm64_sys_mprotect+0x88/0xa8
> 
> Is this a known issue?
> 

That's very odd.  Does anything show up with a lockdep build?  Your
trace comment leads me to believe there is a lot of these triggering
with CONFIG_RCU_STRICT_GRACE_PERIOD, is that correct?

Thanks,
Liam



More information about the maple-tree mailing list