* [PATCH] sched_ext: Make scx_bpf_cpuperf_set() @cpu arg signed
@ 2024-06-23 8:10 David Vernet
2024-06-23 17:54 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: David Vernet @ 2024-06-23 8:10 UTC (permalink / raw)
To: tj; +Cc: linux-kernel, kernel-team
The scx_bpf_cpuperf_set() kfunc allows a BPF program to set the relative
performance target of a specified CPU. Commit d86adb4fc065 ("sched_ext: Add
cpuperf support") defined the @cpu argument to be unsigned. Let's update it
to be signed to match the norm for the rest of ext.c and the kernel.
Note that the kfunc declaration of scx_bpf_cpuperf_set() in the
common.bpf.h header in tools/sched_ext already listed the cpu as signed, so
this also fixes the build for tools/sched_ext and the sched_ext selftests
due to kfunc declarations now being emitted in vmlinux.h based on BTF (thus
causing the compiler to error due to observing conflicting types).
Fixes: d86adb4fc065 ("sched_ext: Add cpuperf support")
Signed-off-by: David Vernet <void@manifault.com>
---
kernel/sched/ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 28f7a4266fde..8e8b44f2c74a 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -5893,7 +5893,7 @@ __bpf_kfunc u32 scx_bpf_cpuperf_cur(s32 cpu)
* use. Consult hardware and cpufreq documentation for more information. The
* current performance level can be monitored using scx_bpf_cpuperf_cur().
*/
-__bpf_kfunc void scx_bpf_cpuperf_set(u32 cpu, u32 perf)
+__bpf_kfunc void scx_bpf_cpuperf_set(s32 cpu, u32 perf)
{
if (unlikely(perf > SCX_CPUPERF_ONE)) {
scx_ops_error("Invalid cpuperf target %u for CPU %d", perf, cpu);
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sched_ext: Make scx_bpf_cpuperf_set() @cpu arg signed
2024-06-23 8:10 [PATCH] sched_ext: Make scx_bpf_cpuperf_set() @cpu arg signed David Vernet
@ 2024-06-23 17:54 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-06-23 17:54 UTC (permalink / raw)
To: David Vernet; +Cc: linux-kernel, kernel-team
On Sun, Jun 23, 2024 at 03:10:36AM -0500, David Vernet wrote:
> The scx_bpf_cpuperf_set() kfunc allows a BPF program to set the relative
> performance target of a specified CPU. Commit d86adb4fc065 ("sched_ext: Add
> cpuperf support") defined the @cpu argument to be unsigned. Let's update it
> to be signed to match the norm for the rest of ext.c and the kernel.
>
> Note that the kfunc declaration of scx_bpf_cpuperf_set() in the
> common.bpf.h header in tools/sched_ext already listed the cpu as signed, so
> this also fixes the build for tools/sched_ext and the sched_ext selftests
> due to kfunc declarations now being emitted in vmlinux.h based on BTF (thus
> causing the compiler to error due to observing conflicting types).
>
> Fixes: d86adb4fc065 ("sched_ext: Add cpuperf support")
> Signed-off-by: David Vernet <void@manifault.com>
Applied to sched_ext/for-6.11.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-23 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-23 8:10 [PATCH] sched_ext: Make scx_bpf_cpuperf_set() @cpu arg signed David Vernet
2024-06-23 17:54 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox