aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejun Heo <[email protected]>2024-08-06 09:40:10 -1000
committerTejun Heo <[email protected]>2024-08-06 09:40:10 -1000
commitcd0144926836b8405966ca9d00f6425ef822fa4b (patch)
tree94141b75f78a5a14b5cfda70787f5dddc67688ed
parent11cc374f4643b1be16deab571e034409c6ee7e66 (diff)
sched_ext: Add scx_enabled() test to @start_class promotion in put_prev_task_balance()
SCX needs its balance() invoked even when waking up from a lower priority sched class (idle) and put_prev_task_balance() thus has the logic to promote @start_class if it's lower than ext_sched_class. This is only needed when SCX is enabled. Add scx_enabled() test to avoid unnecessary overhead when SCX is disabled. Signed-off-by: Tejun Heo <[email protected]> Suggested-by: Peter Zijlstra <[email protected]> Acked-by: David Vernet <[email protected]>
-rw-r--r--kernel/sched/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 38df84d5a9f6..957c1a6626d2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5867,7 +5867,7 @@ static void put_prev_task_balance(struct rq *rq, struct task_struct *prev,
* when waking up from SCHED_IDLE. If @start_class is below SCX, start
* from SCX instead.
*/
- if (sched_class_above(&ext_sched_class, start_class))
+ if (scx_enabled() && sched_class_above(&ext_sched_class, start_class))
start_class = &ext_sched_class;
#endif