Re: [PATCH] mm/mmu_notifier: Remove non_b lock_start/end() from notifier invocation
David Woodhouse <[email protected]>
| Newsgroups | org.kvack.linux-mm,dev.linux.lists.linux-rt-devel,org.kernel.vger.kvm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 12 August 2026 17:04:47 BST, Paolo Bonzini <[email protected]> wrote: >> + * Atomic-flavor readers run with preemption disabled, so every >> + * read-side critical section is bounded and running (not blocked) on >> + * some CPU, which is what makes spinning here sane: the wait is >> + * bounded by the longest such section. No index flip and no >> + * grace-period sequence update occur, so concurrent call_srcu(), >> + * synchronize_srcu() and srcu_barrier() are entirely unaffected. > >Making synchronize_srcu_atomic() spin in CONFIG_PREEMPT_RT is a >slightly tall request - it's basically putting it on the same level as >raw_spinlock. But if the MMU notifier guys really want to make OOM >notifiers atomic, this would be basically the only way to do so. > >If instead it's okay to remove nonblock_start/end under >CONFIG_PREEMPT_RT, for RT kernels I'd rather avoid >preempt_disable/enable and only make synchronize_srcu_atomic() try to >skip the index flip: > > if (!try_synchronize_srcu(ssp)) > synchronize_srcu_expedited(ssp); Yeah, so in the normal case it's truly atomic but in the RT case both readers and grace periods quietly start to sleep again... just like spinlocks in RT. That seems reasonable.