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

From: Steven Rostedt

Date: Tue Aug 11 2026 - 10:55:42 EST


On Tue, 11 Aug 2026 15:33:18 +0100
David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:

> > If might_sleep doesn't work sanely at all in preempt_rt then just
> > globally turn it off?
>
> Turn might_sleep off? Or PREEMPT_RT? :)
>
> The RT maintainers are on this thread if you want to pick either of
> those fights... that was not the course of action I chose to take.

I guess the question is, what exactly is the reason for sleeping to be
prohibited? In RT, sleeping is allowed in most context because most context
are threads (like interrupt handlers and such). Now, you still can't sleep
in NMIs and hard interrupt handlers that were not converted to threads, but
I'm not sure that's the case here anyway.

If the non_block_start() is just a big hammer to make sure things are fine
in non-RT, it will likely still be fine in RT even though it may block and
sleep. But what it blocks on are sleeping spin locks that likely would not
cause an issue here if they didn't cause an issue in non-RT.

Thus, perhaps something like this:

if (ops->invalidate_range_start) {
int _ret;

if (!IS_ENABLED(CONFIG_PREEMPT_RT) && !mmu_notifier_range_blockable(range))
non_block_start();
_ret = ops->invalidate_range_start(subscription, range);
if (!IS_ENABLED(CONFIG_PREEMPT_RT) && !mmu_notifier_range_blockable(range))
non_block_end();

?