From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
akpm@linux-foundation.org, david@kernel.org, mhocko@suse.com,
rostedt@goodmis.org, bigeasy@linutronix.de,
simona.vetter@ffwll.ch, jglisse@redhat.com,
christian.koenig@amd.com, paulmck@kernel.org,
linux-mm@kvack.org, kvm@vger.kernel.org,
linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mmu_notifier: Remove non_block_start/end() from notifier invocation
Date: Tue, 11 Aug 2026 15:58:04 -0700 [thread overview]
Message-ID: <anuo_OxfvJbQnn71@google.com> (raw)
In-Reply-To: <27f2326dc66d6341174c0e510aa518a1297b66ae.camel@infradead.org>
On Tue, Aug 11, 2026, David Woodhouse wrote:
> On Tue, 2026-08-11 at 22:21 +0200, Paolo Bonzini wrote:
> >
> > for_each_present_cpu(cpu)
> > if (per_cpu(kvm_gpc_reader, cpu) == gpc)
> > cpumask_set_cpu(cpu, gpc_readers);
> > __kvm_kick_many_cpus(cpus, wait);
>
>
> I'm literally sitting here watching you reinvent what SRCU already does.
The problem, for me at least, is that SRCU does this and a _lot_ more.
> Which, again, is *fine* given the behaviour of *these* read-side sections.
Well, yeah. Why use a nailgun to put a nail into the wall to hang a picture
frame? (other than the indisputable fact that power tools are fun). SRCU is
fantastic infrastructure, but I genuinely think it's not the right fit here,
especially since we'll likely need a different solution for in-guest readers
anyways.
> I get it. RCU is a versatile tool, and in *some* cases the *Sleepable*
> variant of RCU gets used in ways which would cause grace period latencies
> which are thoroughly unacceptable in an MMU notifier callback.
>
> But in the specific case of a dedicated kvm->gpc_srcu whose only
> readers are tiny snippets of code that until today were always run with
> rwlock_irqsave? That is *not* Jason's worst-case bugbear. It's fine.
I agree it's more than likely fine for your use case, I'm not convinced it'll be
fine for use cases that heavily overcommit memory, or do NUMA balancing, or (close
your eyes) enable KSM.
E.g. it doesn't take all that much for even a single expedited sync to generate
a delay of 20ms.
https://lore.kernel.org/all/20260309193059.2244645-1-seanjc@google.com
next prev parent reply other threads:[~2026-08-11 22:58 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 8:58 [PATCH] mm/mmu_notifier: Remove non_block_start/end() from notifier invocation David Woodhouse
2026-08-11 13:55 ` Jason Gunthorpe
[not found] ` <1d669aca4ffee797b9c29215382444a5b23624b3.camel@infradead.org>
2026-08-11 14:27 ` Jason Gunthorpe
2026-08-11 14:33 ` David Woodhouse
2026-08-11 14:42 ` Steven Rostedt
2026-08-11 15:24 ` David Woodhouse
2026-08-11 15:30 ` Jason Gunthorpe
2026-08-12 8:14 ` Michal Hocko
2026-08-12 8:21 ` David Woodhouse
2026-08-12 12:27 ` Jason Gunthorpe
2026-08-12 13:46 ` David Woodhouse
2026-08-12 13:49 ` Jason Gunthorpe
2026-08-12 14:05 ` David Woodhouse
2026-08-12 14:26 ` Jason Gunthorpe
2026-08-12 14:38 ` David Woodhouse
2026-08-12 14:34 ` David Woodhouse
2026-08-12 15:03 ` David Woodhouse
2026-08-12 15:49 ` David Woodhouse
2026-08-12 16:20 ` Sean Christopherson
2026-08-12 16:04 ` Paolo Bonzini
2026-08-12 16:07 ` Jason Gunthorpe
2026-08-12 8:13 ` Michal Hocko
2026-08-11 15:29 ` Jason Gunthorpe
2026-08-11 15:15 ` David Woodhouse
2026-08-11 15:24 ` Jason Gunthorpe
2026-08-11 15:29 ` David Woodhouse
2026-08-11 16:24 ` Jason Gunthorpe
2026-08-11 17:22 ` David Woodhouse
2026-08-11 17:26 ` Jason Gunthorpe
2026-08-11 17:59 ` David Woodhouse
2026-08-11 18:19 ` Jason Gunthorpe
2026-08-11 20:06 ` Sean Christopherson
2026-08-11 20:21 ` Paolo Bonzini
2026-08-11 21:14 ` David Woodhouse
2026-08-11 22:58 ` Sean Christopherson [this message]
2026-08-11 23:50 ` David Woodhouse
2026-08-12 10:25 ` David Woodhouse
2026-08-12 16:07 ` Sean Christopherson
2026-08-11 20:29 ` David Woodhouse
2026-08-11 15:12 ` David Hildenbrand (Arm)
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=anuo_OxfvJbQnn71@google.com \
--to=seanjc@google.com \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=christian.koenig@amd.com \
--cc=david@kernel.org \
--cc=dwmw2@infradead.org \
--cc=jgg@ziepe.ca \
--cc=jglisse@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mhocko@suse.com \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=rostedt@goodmis.org \
--cc=simona.vetter@ffwll.ch \
/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