From: Dave Hansen <dave.hansen@intel.com>
To: Peter Zijlstra <peterz@infradead.org>, Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, david@kernel.org, will@kernel.org,
aneesh.kumar@kernel.org, npiggin@gmail.com,
linux-arch@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] mm/mmu_gather: replace IPI with synchronize_rcu() when batch allocation fails
Date: Tue, 24 Feb 2026 07:04:10 -0800 [thread overview]
Message-ID: <95c65dab-8a48-4449-aa96-3928f035b07b@intel.com> (raw)
In-Reply-To: <20260224114152.GX1395266@noisy.programming.kicks-ass.net>
On 2/24/26 03:41, Peter Zijlstra wrote:
>> +void tlb_remove_table_sync_rcu(void)
>> +{
>> + might_sleep();
>> + synchronize_rcu();
> synchronize_rcu() should end up in a might_sleep() at some point if it
> blocks (which it typically will).
FWIW, I do prefer the explicit might_sleep() rather than leaving it to
just the documentation. It just makes it easier to find bugs. I'm sure
there's some crazy RCU variant that doesn't often sleep in
synchronize_rcu(). ;)
If it's worth adding a line of comment, it's worth adding a line of code
to actually keep folks honest. This is also going to be a pretty darn
slow path so it shouldn't bloat anything too much.
prev parent reply other threads:[~2026-02-24 15:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 3:07 Lance Yang
2026-02-24 11:04 ` David Hildenbrand (Arm)
2026-02-24 11:32 ` Lance Yang
2026-02-24 11:41 ` Peter Zijlstra
2026-02-24 11:55 ` Peter Zijlstra
2026-02-24 12:18 ` Lance Yang
2026-02-24 12:35 ` Peter Zijlstra
2026-02-24 12:57 ` Lance Yang
2026-02-24 15:04 ` Dave Hansen [this message]
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=95c65dab-8a48-4449-aa96-3928f035b07b@intel.com \
--to=dave.hansen@intel.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@kernel.org \
--cc=david@kernel.org \
--cc=lance.yang@linux.dev \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/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