Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Jason Gunthorpe <jgg@ziepe.ca>, Michal Hocko <mhocko@suse.com>,
	 Steven Rostedt <rostedt@goodmis.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	 "Liam R. Howlett" <liam@infradead.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	 Suren Baghdasaryan <surenb@google.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	 Clark Williams <clrkwllms@kernel.org>,
	Simona Vetter <simona.vetter@ffwll.ch>,
	 Jerome Glisse <jglisse@redhat.com>,
	Christian Koenig <christian.koenig@amd.com>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	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, 1 Sep 2026 15:51:05 -0700	[thread overview]
Message-ID: <apdW2edsT_ZKfuUR@google.com> (raw)
In-Reply-To: <e3197a0a-e167-4ea1-bbde-9c7f11f42198@paulmck-laptop>

On Tue, Sep 01, 2026, Paul E. McKenney wrote:
> On Tue, Sep 01, 2026 at 12:12:51PM -0700, Sean Christopherson wrote:
> > On Tue, Sep 01, 2026, David Woodhouse wrote:
> > > On Mon, 2026-08-31 at 17:58 -0700, Paul E. McKenney wrote:
> > > > On Fri, Aug 28, 2026 at 12:25:01AM +0100, David Woodhouse wrote:
> > > > 
> > > > 
> > > > >   * 23f10e07aba3 srcu: Add try_synchronize_srcu() for callers which can prove readers absent
> > > > 
> > > > I do not intend to provide a separate API for this given the possibility
> > > > of indefinite postponement.
> > > 
> > > Makes sense. In that case, calling it internally from the 'right'
> > > places becomes important, as the callers who care can't do so for
> > > themselves.
> > > 
> > > We discussed the fact that synchronize_srcu_expedited() will also want
> > > to use the same fast path.
> > > 
> > > I'm also looking back to Sean's call_srcu_expedited() patch from March:
> > > https://lore.kernel.org/all/20260309193059.2244645-1-seanjc@google.com/
> > > 
> > > 
> > > | Due to differences in how VMMs manage guest devices, and in the
> > > | architecture being emulated by userspace, some updates trigger call_srcu()
> > > | with concurrent readers (i.e. while the VM is active), while others occur
> > > | without readers, e.g. when configuring devices during a pre-boot setup.
> > > | For the later case (no concurrent readers), using the vanilla call_srcu()
> > > | is problematic, as it can kick off a normal grace period (totally fine for
> > > | freeing the object) and effectively transfer the non-expedited grace period
> > > | to the upcoming synchronize_srcu_expedited().
> > > 
> > > So the offending path uses call_srcu() and triggers a normal GP, while
> > > the victim calls synchronize_srcu_expedited() and gets stuck behind
> > > that non-expedited GP.
> > > 
> > > Sean, if the victim is the "no concurrent readers" code path, as you
> > > said above, do you think the fast path in the victim should suffice,
> > > without the cost of an expedited GP for every bus registration?
> > 
> > IIUC, you're asking if being able to use try_synchronize_srcu() for the fast/happy
> > of synchronize_srcu_expedited() (i.e. for kvm_swap_active_memslots()()), even if
> > there's an in-flight GP, would suffice for a fix of the regression introduced by
> > commit 7d9a0273c459 ("KVM: Avoid synchronize_srcu() in kvm_io_bus_register_dev()").
> > 
> > If my understanding is correct, then yes, that should work, and presumably would
> > be a notable improvement overall.
> 
> Then we could abandon synchronize_rcu_atomic()?  That would not be a
> bad thing from my perspective.
> 
> Just to be sure, please note that synchronize_rcu_expedited() can and
> sometimes does sleep in order to avoid odd corner cases that could
> otherwise pointlessly monopolize a CPU.

I think one (or both) of us is confused.  I thought David was asking if we could
avoiding adding call_srcu_expedited(), because the proposed try_synchronize_srcu()
would fix a regression related to KVM's use of synchronize_srcu_expedited().

I don't think that has anything to do with non-sleepable RCU?  Or is there a
separate discussion and/or implicitations I don't understand?


  reply	other threads:[~2026-09-01 22:51 UTC|newest]

Thread overview: 82+ 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
2026-08-11 14:21   ` David Woodhouse
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-13 10:05                             ` David Woodhouse
2026-08-13 13:59                               ` Sean Christopherson
2026-08-13 14:40                                 ` Jason Gunthorpe
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 17:17                                 ` David Woodhouse
2026-08-12 21:38                                   ` Paul E. McKenney
2026-08-12 21:55                                     ` David Woodhouse
2026-08-13  7:54                                     ` David Woodhouse
2026-08-18 18:18                                       ` Paul E. McKenney
2026-08-18 18:28                                         ` David Woodhouse
2026-08-20 14:43                                         ` David Woodhouse
2026-08-21 17:38                                           ` Paul E. McKenney
2026-08-25 12:15                                             ` David Woodhouse
2026-08-25 16:47                                               ` Paul E. McKenney
2026-08-25 17:05                                                 ` David Woodhouse
2026-08-25 17:19                                                   ` Paul E. McKenney
2026-08-25 17:48                                                     ` David Woodhouse
2026-08-25 18:16                                                       ` Paul E. McKenney
2026-08-25 19:58                                                         ` Sean Christopherson
2026-08-25 20:51                                                           ` Paul E. McKenney
2026-08-26  7:32                                                             ` Sebastian Andrzej Siewior
2026-08-26  7:38                                                               ` David Woodhouse
2026-08-26 15:05                                                                 ` Paul E. McKenney
2026-08-26 16:28                                                                   ` Paul E. McKenney
2026-08-26 18:01                                                                     ` David Woodhouse
2026-08-26 19:59                                                                       ` Paul E. McKenney
2026-08-26 20:30                                                                         ` David Woodhouse
2026-08-26 21:04                                                                           ` Paul E. McKenney
2026-08-27  8:20                                                                             ` Sebastian Andrzej Siewior
2026-08-27 23:25                                                         ` David Woodhouse
2026-08-28 23:18                                                           ` David Woodhouse
     [not found]                                                           ` <90d91673-a912-439f-98ee-e43285294486@paulmck-laptop>
2026-09-01  9:40                                                             ` David Woodhouse
2026-09-01 19:12                                                               ` Sean Christopherson
2026-09-01 20:40                                                                 ` Paul E. McKenney
2026-09-01 22:51                                                                   ` Sean Christopherson [this message]
2026-09-01 22:53                                                                     ` David Woodhouse
2026-09-01 23:05                                                                       ` Paul E. McKenney
2026-08-12 16:04                             ` Paolo Bonzini
2026-08-12 16:07                               ` Jason Gunthorpe
2026-08-12 17:49                               ` David Woodhouse
2026-08-20 13:30                                 ` Sebastian Andrzej Siewior
2026-08-20 14:26                                   ` David Woodhouse
2026-08-20 15:34                                     ` Sebastian Andrzej Siewior
2026-08-20 18:49                                       ` David Woodhouse
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
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=apdW2edsT_ZKfuUR@google.com \
    --to=seanjc@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=christian.koenig@amd.com \
    --cc=clrkwllms@kernel.org \
    --cc=david@kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=jgg@ziepe.ca \
    --cc=jglisse@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rppt@kernel.org \
    --cc=simona.vetter@ffwll.ch \
    --cc=surenb@google.com \
    --cc=vbabka@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