From: George Guo <dongtai.guo@linux.dev>
To: arighi@nvidia.com
Cc: changwoo@igalia.com, dongtai.guo@linux.dev, etsal@meta.com,
guodongtai@kylinos.cn, linux-kernel@vger.kernel.org,
sched-ext@lists.linux.dev, tj@kernel.org, void@manifault.com
Subject: [PATCH v2 1/1] sched_ext: Add error logging for dsq creation failures
Date: Fri, 9 Jan 2026 18:03:58 +0800 [thread overview]
Message-ID: <20260109100358.93045-1-dongtai.guo@linux.dev> (raw)
From: George Guo <guodongtai@kylinos.cn>
Add scx_bpf_error() calls when scx_bpf_create_dsq() fails in multiple
schedulers to improve debuggability:
- scx_central.bpf.c: central_init()
- scx_flatcg.bpf.c: fcg_cgroup_init() and fcg_init()
- scx_qmap.bpf.c: qmap_init()
Signed-off-by: George Guo <guodongtai@kylinos.cn>
---
tools/sched_ext/scx_central.bpf.c | 4 +++-
tools/sched_ext/scx_flatcg.bpf.c | 4 +++-
tools/sched_ext/scx_qmap.bpf.c | 8 ++++++--
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/tools/sched_ext/scx_central.bpf.c b/tools/sched_ext/scx_central.bpf.c
index 55df8b798865..1c2376b75b5d 100644
--- a/tools/sched_ext/scx_central.bpf.c
+++ b/tools/sched_ext/scx_central.bpf.c
@@ -301,8 +301,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(central_init)
int ret;
ret = scx_bpf_create_dsq(FALLBACK_DSQ_ID, -1);
- if (ret)
+ if (ret) {
+ scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
return ret;
+ }
timer = bpf_map_lookup_elem(¢ral_timer, &key);
if (!timer)
diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
index 43126858b8e4..c216480c3ee0 100644
--- a/tools/sched_ext/scx_flatcg.bpf.c
+++ b/tools/sched_ext/scx_flatcg.bpf.c
@@ -842,8 +842,10 @@ int BPF_STRUCT_OPS_SLEEPABLE(fcg_cgroup_init, struct cgroup *cgrp,
* unlikely case that it breaks.
*/
ret = scx_bpf_create_dsq(cgid, -1);
- if (ret)
+ if (ret) {
+ scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
return ret;
+ }
cgc = bpf_cgrp_storage_get(&cgrp_ctx, cgrp, 0,
BPF_LOCAL_STORAGE_GET_F_CREATE);
diff --git a/tools/sched_ext/scx_qmap.bpf.c b/tools/sched_ext/scx_qmap.bpf.c
index df21fad0c438..5fdd83769405 100644
--- a/tools/sched_ext/scx_qmap.bpf.c
+++ b/tools/sched_ext/scx_qmap.bpf.c
@@ -866,12 +866,16 @@ s32 BPF_STRUCT_OPS_SLEEPABLE(qmap_init)
print_cpus();
ret = scx_bpf_create_dsq(SHARED_DSQ, -1);
- if (ret)
+ if (ret) {
+ scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
return ret;
+ }
ret = scx_bpf_create_dsq(HIGHPRI_DSQ, -1);
- if (ret)
+ if (ret) {
+ scx_bpf_error("scx_bpf_create_dsq failed (%d)", ret);
return ret;
+ }
timer = bpf_map_lookup_elem(&monitor_timer, &key);
if (!timer)
--
2.49.0
next reply other threads:[~2026-01-09 10:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 10:03 George Guo [this message]
2026-01-09 10:11 ` [PATCH v2 1/1] sched_ext: Add error logging for dsq creation failures Andrea Righi
2026-01-09 10:39 ` George Guo
2026-01-09 11:07 ` Andrea Righi
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=20260109100358.93045-1-dongtai.guo@linux.dev \
--to=dongtai.guo@linux.dev \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=etsal@meta.com \
--cc=guodongtai@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--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