[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240804024047.100355-3-tj@kernel.org>
Date: Sat, 3 Aug 2024 16:40:09 -1000
From: Tejun Heo <tj@...nel.org>
To: void@...ifault.com,
peterz@...radead.org
Cc: linux-kernel@...r.kernel.org,
kernel-team@...a.com,
mingo@...hat.com,
Tejun Heo <tj@...nel.org>
Subject: [PATCH 2/6] 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 <tj@...nel.org>
Suggested-by: Peter Zijlstra <peterz@...radead.org>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 7994118eee53..0532b27fd9af 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5836,7 +5836,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
--
2.46.0
Powered by blists - more mailing lists