[1/2] sched/preempt: Remove preceding unnecessary enables in __sched_dynamic_update
Commit Message
The preempt mode transitions are based on SC's static_call_update()
and SK's static_key_enable/disable() APIs.
Once these static calls and static keys are initialized, APIs can
work well regardless of the states of them (detailly speaking, the
instructions in SC's call site/trampoline or SK's jump_entry::code).
There is no need to enable these points all at the beginning,
updating them directly is enough.
Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
---
kernel/sched/core.c | 11 -----------
1 file changed, 11 deletions(-)
@@ -8732,17 +8732,6 @@ static bool klp_override;
static void __sched_dynamic_update(int mode)
{
- /*
- * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in
- * the ZERO state, which is invalid.
- */
- if (!klp_override)
- preempt_dynamic_enable(cond_resched);
- preempt_dynamic_enable(might_resched);
- preempt_dynamic_enable(preempt_schedule);
- preempt_dynamic_enable(preempt_schedule_notrace);
- preempt_dynamic_enable(irqentry_exit_cond_resched);
-
switch (mode) {
case preempt_dynamic_none:
if (!klp_override)