From: David Vernet <void@manifault.com>
To: tj@kernel.org
Cc: sched-ext@meta.com, kernel-team@meta.com,
linux-kernel@vger.kernel.org, ihor.solodrai@pm.me
Subject: [PATCH] scx: Fix maximal BPF selftest prog
Date: Mon, 9 Dec 2024 09:29:24 -0600 [thread overview]
Message-ID: <20241209152924.4508-1-void@manifault.com> (raw)
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
next reply other threads:[~2024-12-09 15:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 15:29 David Vernet [this message]
2024-12-10 14:37 ` [PATCH] scx: Fix maximal BPF selftest prog 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
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=20241209152924.4508-1-void@manifault.com \
--to=void@manifault.com \
--cc=ihor.solodrai@pm.me \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@meta.com \
--cc=tj@kernel.org \
/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