Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Pedro Falcato <pfalcato@suse.de>
Cc: Andi Kleen <ak@kernel.org>,
	akpm@linux-foundation.org, liam@infradead.org, ljs@kernel.org,
	jannh@google.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RCU safety for vma maple tree walks
Date: Mon, 31 Aug 2026 12:35:30 -0700	[thread overview]
Message-ID: <apXXgimKxgJl57qo@firstfloor.org> (raw)
In-Reply-To: <apWUsc-a6k1YkuMv@pedro-suse>

> 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



  reply	other threads:[~2026-08-31 19:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 14:35 [PATCH] RCU safety for vma maple tree walks Andi Kleen
2026-08-31 14:58 ` Pedro Falcato
2026-08-31 19:35   ` Andi Kleen [this message]
2026-08-31 19:55     ` Lorenzo Stoakes (ARM)
2026-09-01 21:05       ` Andi Kleen
2026-09-02 16:21         ` Lorenzo Stoakes (ARM)
2026-08-31 15:50 ` Lorenzo Stoakes (ARM)
2026-08-31 16:29 ` Liam R. Howlett
2026-08-31 16:52   ` Andi Kleen
2026-08-31 22:13     ` Liam R. Howlett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=apXXgimKxgJl57qo@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=pfalcato@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox