public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scx: Fix maximal BPF selftest prog
@ 2024-12-09 15:29 David Vernet
  2024-12-10 14:37 ` Andrea Righi
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: David Vernet @ 2024-12-09 15:29 UTC (permalink / raw)
  To: tj; +Cc: sched-ext, kernel-team, linux-kernel, ihor.solodrai

maximal.bpf.c is still dispatching to and consuming from SCX_DSQ_GLOBAL.
Let's have it use its own DSQ to avoid any runtime errors.

Signed-off-by: David Vernet <void@manifault.com>
---
 tools/testing/selftests/sched_ext/maximal.bpf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/sched_ext/maximal.bpf.c b/tools/testing/selftests/sched_ext/maximal.bpf.c
index 4c005fa71810..430f5e13bf55 100644
--- a/tools/testing/selftests/sched_ext/maximal.bpf.c
+++ b/tools/testing/selftests/sched_ext/maximal.bpf.c
@@ -12,6 +12,8 @@
 
 char _license[] SEC("license") = "GPL";
 
+#define DSQ_ID 0
+
 s32 BPF_STRUCT_OPS(maximal_select_cpu, struct task_struct *p, s32 prev_cpu,
 		   u64 wake_flags)
 {
@@ -20,7 +22,7 @@ s32 BPF_STRUCT_OPS(maximal_select_cpu, struct task_struct *p, s32 prev_cpu,
 
 void BPF_STRUCT_OPS(maximal_enqueue, struct task_struct *p, u64 enq_flags)
 {
-	scx_bpf_dsq_insert(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
+	scx_bpf_dsq_insert(p, DSQ_ID, SCX_SLICE_DFL, enq_flags);
 }
 
 void BPF_STRUCT_OPS(maximal_dequeue, struct task_struct *p, u64 deq_flags)
@@ -28,7 +30,7 @@ void BPF_STRUCT_OPS(maximal_dequeue, struct task_struct *p, u64 deq_flags)
 
 void BPF_STRUCT_OPS(maximal_dispatch, s32 cpu, struct task_struct *prev)
 {
-	scx_bpf_dsq_move_to_local(SCX_DSQ_GLOBAL);
+	scx_bpf_dsq_move_to_local(DSQ_ID);
 }
 
 void BPF_STRUCT_OPS(maximal_runnable, struct task_struct *p, u64 enq_flags)
@@ -123,7 +125,7 @@ void BPF_STRUCT_OPS(maximal_cgroup_set_weight, struct cgroup *cgrp, u32 weight)
 
 s32 BPF_STRUCT_OPS_SLEEPABLE(maximal_init)
 {
-	return 0;
+	return scx_bpf_create_dsq(DSQ_ID, -1);
 }
 
 void BPF_STRUCT_OPS(maximal_exit, struct scx_exit_info *info)
-- 
2.46.1


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

end of thread, other threads:[~2025-01-27 18:45 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09 15:29 [PATCH] scx: Fix maximal BPF selftest prog David Vernet
2024-12-10 14:37 ` Andrea Righi
2024-12-10 20:52 ` Ihor Solodrai
2024-12-11 21:01   ` [PATCH sched_ext/for-6.13-fixes] sched_ext: Fix invalid irq restore in scx_ops_bypass() Tejun Heo
2024-12-11 21:03     ` Tejun Heo
2024-12-12 18:12     ` Ihor Solodrai
2024-12-17 23:44       ` Ihor Solodrai
2024-12-18 18:34         ` Tejun Heo
2024-12-19 22:51           ` Ihor Solodrai
2024-12-20 19:26             ` Ihor Solodrai
2024-12-25  0:09             ` [PATCH sched_ext/for-6.13-fixes] sched_ext: Fix dsq_local_on selftest Tejun Heo
2024-12-25  0:10               ` Tejun Heo
2025-01-15 23:50               ` Ihor Solodrai
2025-01-22  1:40                 ` Tejun Heo
2025-01-22 19:10                   ` Ihor Solodrai
2025-01-23  9:40                     ` Andrea Righi
2025-01-23 16:57                       ` Tejun Heo
2025-01-23 18:45                         ` Andrea Righi
2025-01-23 22:26                           ` Andrea Righi
2025-01-24 22:00                             ` [PATCH sched_ext/for-6.14-fixes] sched_ext: selftests/dsp_local_on: Fix sporadic failures Tejun Heo
2025-01-25  4:54                               ` Andrea Righi
2025-01-27 18:45                                 ` Tejun Heo
2024-12-11  6:31 ` [PATCH] scx: Fix maximal BPF selftest prog Tejun Heo

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