Re: [PATCH] sched: Make preempt_enable_no_resched() behave like preempt_enable() on PREEMPT_RT

From: Sebastian Andrzej Siewior
Date: Tue Mar 01 2022 - 15:27:51 EST


On 2022-03-01 21:14:32 [+0100], Peter Zijlstra wrote:
> Ignoring !x86 for a moment:
>
> arch/x86/mm/kmmio.c: preempt_enable_no_resched();
> arch/x86/mm/kmmio.c: preempt_enable_no_resched();
> include/linux/preempt.h:#define sched_preempt_enable_no_resched() \
> include/linux/preempt.h:#define preempt_enable_no_resched() sched_preempt_enable_no_resched()
> include/linux/preempt.h:#define preempt_enable_no_resched_notrace() \
> include/linux/preempt.h:#define sched_preempt_enable_no_resched() barrier()
> include/linux/preempt.h:#define preempt_enable_no_resched() barrier()
> include/linux/preempt.h:#define preempt_enable_no_resched_notrace() barrier()
> include/linux/preempt.h:#undef sched_preempt_enable_no_resched
> include/linux/preempt.h:#undef preempt_enable_no_resched
> include/linux/preempt.h:#undef preempt_enable_no_resched_notrace
> kernel/sched/core.c: preempt_enable_no_resched();
> kernel/sched/core.c: preempt_enable_no_resched();
> kernel/sched/core.c: sched_preempt_enable_no_resched();
> kernel/sched/core.c: sched_preempt_enable_no_resched();
> kernel/sched/core.c: sched_preempt_enable_no_resched();
> kernel/sched/core.c: preempt_enable_no_resched_notrace();
> kernel/sched/core.c: preempt_enable_no_resched_notrace();
> kernel/sched/core.c: sched_preempt_enable_no_resched();
> kernel/sched/core.c: sched_preempt_enable_no_resched();
> kernel/signal.c: preempt_enable_no_resched();
> kernel/smpboot.c: preempt_enable_no_resched();
> lib/smp_processor_id.c: preempt_enable_no_resched_notrace();
>
>
> Surely we can audit that... At a glance the proposed patch does more
> harm than good. Only the kmmio case looks obviousl fail, but then IIRC
> kmmio had worse problems.

I was looking at the same before posting it. The majority of it
disappeared over time after certain someone made it worthless for
modules. So I'm dropping it then.
Does it make sense to keep sched_preempt_enable_no_resched() or should I
move everything to preempt_enable_no_resched()?

Sebastian