Re: [PATCH] mm/mmu_notifier: Remove non_block_start/end() from notifier invocation

David Woodhouse <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.linux-rt-devel,org.kernel.vger.kvm,org.kvack.linux-mm
Message-ID <[email protected]>
On Wed, 2026-08-12 at 09:27 -0300, Jason Gunthorpe wrote:
> On Wed, Aug 12, 2026 at 09:21:31AM +0100, David Woodhouse wrote:
> > On Wed, 2026-08-12 at 10:14 +0200, Michal Hocko wrote:
> > > On Tue 11-08-26 16:24:48, David Woodhouse wrote:
> > > [...]
> > > > I had a second reason for disabling the overzealous check too: to allow
> > > > SRCU grace periods within the notifier callbacks.
> > > 
> > > Is there a way that srcu barrier could cause an indirect dependency on
> > > memory allocation? In other words what might block the scru to complete?
> > 
> > Not after https://lore.kernel.org/all/[email protected]/
> 
> The user of the SRCU might have a read side that wraps an allocate. In
> general it is not safe.

Sure, the *general* case of Sleepable RCU can do all kinds of stuff in
the read-side sections.

But in *this* case they were all read_lock_irqsave() thus far, and they
absolutely categorically do not.

> I'm skeptical that without special API and documentation the KVM
> special use of SRCU you've outlined will not remain working long term
> too..

I hear you. I'm less sceptical, given the use case, but I'll certainly
concede that the universe is known for inventing better idiots.

I'm certainly not averse to having a wrapper so that the read sections
don't just srcu_read_lock() directly, but also get a sanity check
(non_block_start? local_irq_save? what would it actually be? does it
have to be different for the hardirq vs. process-context invocations?)
for free.

Or instead of a GPC-specific wrapper, do we make it a first-class SRCU
citizen, SRCU_READ_FLAVOR_ATOMIC? If it disables preemption, we'd know
that lock+unlock must happen on the *same* CPU, which could potentially
simplify my new try_synchronize_srcu() and/or allow for a *spinning*
grace period if we really do want that (although I'm unconvinced; it's
*latency* we care about here, and punting to the WQ when we *already*
have to wait is fair enough).

Either way, I see that as a mostly cosmetic follow-on from the real
fixes I'm chasing here.
smime.p7s (application/pkcs7-signature, 6 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.