sched/preempt: Bypass setting same mode for sched_dynamic_update()
PATCH 1/1 sched/preempt: Bypass setting same mode for sched_dynamic_update()
If the preempt mode to set is same with current preempt mode, there is no need to update all the cond_resched, might_resched, preempt_schedule, preempt_schedule_notrace and irqentry_exit_cond_resched state.
Signed-off-by Jinjie Ruan <[email protected]>
--- kernel/sched/core.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/sched/core.c +3 -0
@@ -8777,6 +8777,9 @@ static bool klp_override;static void __sched_dynamic_update (int mode) { +if (mode == preempt_dynamic_mode) +return ; +/* * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in * the ZERO state, which is invalid.
Signature · 1 line
2.34.1
Peter Zijlstra
maintainerQuoted 3 lines · Jinjie Ruan
If the preempt mode to set is same with current preempt mode, there is no need to update all the
cond_resched,might_resched,preempt_schedule,preempt_schedule_notraceandirqentry_exit_cond_reschedstate.
IIRC this actively breaks things, also this is a super slow path, nobody should care.
Quoted 22 lines
Signed-off-by Jinjie Ruan <[email protected]>--- kernel/sched/core.c | 3 +++ 1 file changed, 3 insertions(+)kernel/sched/core.c +3
-0@@ -8777,6 +8777,9 @@ static bool klp_override;static void __sched_dynamic_update (int mode) { +if (mode == preempt_dynamic_mode) +return ; +/* * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in * the ZERO state, which is invalid. Signature · 1 line
2.34.1