mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH sched_ext/for-6.12-fixes] Disable SM_IDLE/rq empty path when scx_enabled
@ 2024-09-20 19:41 Pat Somaru
  2024-09-23 15:43 ` Tejun Heo
  0 siblings, 1 reply; 5+ messages in thread
From: Pat Somaru @ 2024-09-20 19:41 UTC (permalink / raw)
  To: tj, void; +Cc: linux-kernel, kernel-team, sched-ext, peterz, Pat Somaru

Disable the rq empty path when scx is enabled. SCX must consult the
BPF scheduler (via the dispatch path in balance) to determine if rq
is empty.

This fixes stalls when scx is enabled.

Signed-off-by: Pat Somaru <patso@likewhatevs.io>
Fixes: 3dcac251b066 ("sched/core: Introduce SM_IDLE and an idle re-entry fast-path in __schedule()")
---
 kernel/sched/core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c415d61a646b5..6a1f662a5e118 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6591,7 +6591,11 @@ static void __sched notrace __schedule(int sched_mode)
 	 */
 	prev_state = READ_ONCE(prev->__state);
 	if (sched_mode == SM_IDLE) {
-		if (!rq->nr_running) {
+		/*
+		 * scx needs to check the bpf scheduler to determine
+		 * if rq is empty, so disable this path for it.
+		 */
+		if (!rq->nr_running && !scx_enabled()) {
 			next = prev;
 			goto picked;
 		}
-- 
2.44.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-25  3:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-20 19:41 [PATCH sched_ext/for-6.12-fixes] Disable SM_IDLE/rq empty path when scx_enabled Pat Somaru
2024-09-23 15:43 ` Tejun Heo
2024-09-24  3:40   ` K Prateek Nayak
2024-09-24 22:21     ` Tejun Heo
2024-09-25  3:17       ` K Prateek Nayak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®