]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/sched_ext: Add error logging for dsq creation failures in remaining schedulers
authorzhidao su <soolaugust@gmail.com>
Fri, 30 Jan 2026 10:55:11 +0000 (18:55 +0800)
committerTejun Heo <tj@kernel.org>
Sun, 1 Feb 2026 17:10:18 +0000 (07:10 -1000)
Add scx_bpf_error() calls when scx_bpf_create_dsq() fails in the remaining
schedulers to improve debuggability:

- scx_simple.bpf.c: simple_init()
- scx_sdt.bpf.c: sdt_init()
- scx_cpu0.bpf.c: cpu0_init()
- scx_flatcg.bpf.c: fcg_init()

This follows the same pattern established in commit 2f8d489897ae
("sched_ext: Add error logging for dsq creation failures") for other
schedulers and ensures consistent error reporting across all schedulers.

Signed-off-by: zhidao su <suzhidao@xiaomi.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/scx_cpu0.bpf.c
tools/sched_ext/scx_flatcg.bpf.c
tools/sched_ext/scx_sdt.bpf.c
tools/sched_ext/scx_simple.bpf.c

index 6326ce598c8e9c9ad3e8fbc48fc0a7ba9062010f..9b67ab11b04c7cb8bd343edad90fa54c45d590db 100644 (file)
@@ -71,7 +71,15 @@ void BPF_STRUCT_OPS(cpu0_dispatch, s32 cpu, struct task_struct *prev)
 
 s32 BPF_STRUCT_OPS_SLEEPABLE(cpu0_init)
 {
-       return scx_bpf_create_dsq(DSQ_CPU0, -1);
+       int ret;
+
+       ret = scx_bpf_create_dsq(DSQ_CPU0, -1);
+       if (ret) {
+               scx_bpf_error("failed to create DSQ %d (%d)", DSQ_CPU0, ret);
+               return ret;
+       }
+
+       return 0;
 }
 
 void BPF_STRUCT_OPS(cpu0_exit, struct scx_exit_info *ei)
index c216480c3ee05d2ff6f33d4686f60b21f503fcdf..0e785cff0f24cd512fcbc2f312ae501e06daeba3 100644 (file)
@@ -929,7 +929,15 @@ void BPF_STRUCT_OPS(fcg_cgroup_move, struct task_struct *p,
 
 s32 BPF_STRUCT_OPS_SLEEPABLE(fcg_init)
 {
-       return scx_bpf_create_dsq(FALLBACK_DSQ, -1);
+       int ret;
+
+       ret = scx_bpf_create_dsq(FALLBACK_DSQ, -1);
+       if (ret) {
+               scx_bpf_error("failed to create DSQ %d (%d)", FALLBACK_DSQ, ret);
+               return ret;
+       }
+
+       return 0;
 }
 
 void BPF_STRUCT_OPS(fcg_exit, struct scx_exit_info *ei)
index 48ea18614e28d72762b25a2e17059b94151f024e..d965f7d209def2592df1ad2d9c466b131a15013b 100644 (file)
@@ -691,7 +691,13 @@ s32 BPF_STRUCT_OPS_SLEEPABLE(sdt_init)
                return ret;
        }
 
-       return scx_bpf_create_dsq(SHARED_DSQ, -1);
+       ret = scx_bpf_create_dsq(SHARED_DSQ, -1);
+       if (ret) {
+               scx_bpf_error("failed to create DSQ %d (%d)", SHARED_DSQ, ret);
+               return ret;
+       }
+
+       return 0;
 }
 
 void BPF_STRUCT_OPS(sdt_exit, struct scx_exit_info *ei)
index e6de99dba7db6a407f4ebe9deaa4a1105d3c9f3b..b456bd7cae77e2ba623e06c79b47185127bc725d 100644 (file)
@@ -131,7 +131,15 @@ void BPF_STRUCT_OPS(simple_enable, struct task_struct *p)
 
 s32 BPF_STRUCT_OPS_SLEEPABLE(simple_init)
 {
-       return scx_bpf_create_dsq(SHARED_DSQ, -1);
+       int ret;
+
+       ret = scx_bpf_create_dsq(SHARED_DSQ, -1);
+       if (ret) {
+               scx_bpf_error("failed to create DSQ %d (%d)", SHARED_DSQ, ret);
+               return ret;
+       }
+
+       return 0;
 }
 
 void BPF_STRUCT_OPS(simple_exit, struct scx_exit_info *ei)