From: Tejun Heo <tj@kernel.org>
To: Pat Somaru <patso@likewhatevs.io>
Cc: void@manifault.com, linux-kernel@vger.kernel.org,
kernel-team@meta.com, sched-ext@meta.com, peterz@infradead.org
Subject: Re: [PATCH sched_ext/for-6.12-fixes] Disable SM_IDLE/rq empty path when scx_enabled
Date: Mon, 23 Sep 2024 05:43:10 -1000 [thread overview]
Message-ID: <ZvGMjn1Va3aNbieH@slm.duckdns.org> (raw)
In-Reply-To: <20240920194159.158152-1-patso@likewhatevs.io>
Applied to sched_ext/for-6.12-fixes with minor edits:
------ 8< ------
From edf1c586e92675c4e0eb27758fcdb55a56838de1 Mon Sep 17 00:00:00 2001
From: Pat Somaru <patso@likewhatevs.io>
Date: Fri, 20 Sep 2024 15:41:59 -0400
Subject: [PATCH] sched, sched_ext: Disable SM_IDLE/rq empty path when
scx_enabled()
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()")
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/sched/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index b6cc1cf499d6..43e453ab7e20 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6591,7 +6591,8 @@ static void __sched notrace __schedule(int sched_mode)
*/
prev_state = READ_ONCE(prev->__state);
if (sched_mode == SM_IDLE) {
- if (!rq->nr_running) {
+ /* SCX must consult the BPF scheduler to tell if rq is empty */
+ if (!rq->nr_running && !scx_enabled()) {
next = prev;
goto picked;
}
--
2.46.0
next prev parent reply other threads:[~2024-09-23 15:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 19:41 Pat Somaru
2024-09-23 15:43 ` Tejun Heo [this message]
2024-09-24 3:40 ` K Prateek Nayak
2024-09-24 22:21 ` Tejun Heo
2024-09-25 3:17 ` K Prateek Nayak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZvGMjn1Va3aNbieH@slm.duckdns.org \
--to=tj@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patso@likewhatevs.io \
--cc=peterz@infradead.org \
--cc=sched-ext@meta.com \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®