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

From: David Woodhouse

Date: Wed Aug 12 2026 - 13:50:23 EST


On 12 August 2026 17:04:47 BST, Paolo Bonzini <pbonzini@xxxxxxxxxx> 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.