Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: "Liam R. Howlett" <liam@infradead.org>
Cc: Andi Kleen <ak@kernel.org>,
	akpm@linux-foundation.org, ljs@kernel.org, jannh@google.com,
	pfalcato@suse.de, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RCU safety for vma maple tree walks
Date: Mon, 31 Aug 2026 09:52:28 -0700	[thread overview]
Message-ID: <apWxTNwhaMU3XiZP@firstfloor.org> (raw)
In-Reply-To: <nq4g527ozizmp2iqmozau7xwgdq4cny43onciw2mw7vu4bwabg@uzkdpjchygkn>

> 
> Did you check this with lockdep?

Yes all tests were running with lockdep, and it didn't trigger.

> 
> Any access to the maple tree without holding the write lock or the rcu
> read lock will cause lockdep to complain.

Hmm, seems that's not working for some reason?

The VM callers of for_each_vma clearly don't take rcu read locks.

> 
> Likewise, any sleeping while holding the rcu read lock would produce
> warnings.

Right but the walkers don't use the read lock.
 
> Note that you do not need to hold the rcu read lock on the vma maple
> tree if you have the write lock.  This looks to be the case for most (or
> all?) of the cases you have below.

Yes the write lock is hold (like I discussed).  The problem isn't parallel
modification but that splitting during the walk invalidates the
iterator caching if you sleep too. That's all purely on the local
thread. The only contribution from others is to cause more sleeping
due to memory pressure or rescheduling.

-Andi


  reply	other threads:[~2026-08-31 16:52 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
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 [this message]
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=apWxTNwhaMU3XiZP@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