diff options
| author | Tejun Heo <tj@kernel.org> | 2026-07-18 00:04:25 -1000 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-07-19 21:11:04 -1000 |
| commit | b20dfde5ec543597f7f178f7b96cf6ebcc50e5ee (patch) | |
| tree | 05756e9453f8f9736e370f37a9d16446e396f83a /tools | |
| parent | d327796bd05d60500951edf5560a10bbff978d5b (diff) | |
| download | linux-b20dfde5ec543597f7f178f7b96cf6ebcc50e5ee.tar.gz linux-b20dfde5ec543597f7f178f7b96cf6ebcc50e5ee.zip | |
sched_ext: Rename the cid-form cgroup ops to cpuctl_*
Two unrelated things go by "cgroup" in the cid form. Sub-schedulers attach
to cgroups, and the cgroup_*() ops deliver cpu controller events. While the
ops names suggest cgroup2 hierarchy, they actually operate on the cpu
controller.
Rename them to cpuctl_* in struct sched_ext_ops_cid, which has no users
outside scx_qmap yet. The cpu form is deployed ABI and keeps the old names.
The layout is unchanged and the kernel keeps calling through the cpu-form
union view.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/sched_ext/scx_qmap.bpf.c | 22 | ||||
| -rw-r--r-- | tools/sched_ext/scx_qmap.c | 2 | ||||
| -rw-r--r-- | tools/sched_ext/scx_qmap.h | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/tools/sched_ext/scx_qmap.bpf.c b/tools/sched_ext/scx_qmap.bpf.c index 925ae1a1d440..aead17658573 100644 --- a/tools/sched_ext/scx_qmap.bpf.c +++ b/tools/sched_ext/scx_qmap.bpf.c @@ -1014,7 +1014,7 @@ void BPF_STRUCT_OPS(qmap_dump_task, struct scx_dump_ctx *dctx, struct task_struc taskc->force_local, taskc->core_sched_seq); } -s32 BPF_STRUCT_OPS(qmap_cgroup_init, struct cgroup *cgrp, struct scx_cgroup_init_args *args) +s32 BPF_STRUCT_OPS(qmap_cpuctl_init, struct cgroup *cgrp, struct scx_cgroup_init_args *args) { QMAP_TOUCH_ARENA(); @@ -1036,7 +1036,7 @@ s32 BPF_STRUCT_OPS(qmap_cgroup_init, struct cgroup *cgrp, struct scx_cgroup_init static void redistribute(void); -void BPF_STRUCT_OPS(qmap_cgroup_set_weight, struct cgroup *cgrp, u32 weight) +void BPF_STRUCT_OPS(qmap_cpuctl_set_weight, struct cgroup *cgrp, u32 weight) { u64 cgid = cgrp->kn->id; s32 i; @@ -1062,16 +1062,16 @@ void BPF_STRUCT_OPS(qmap_cgroup_set_weight, struct cgroup *cgrp, u32 weight) } } -void BPF_STRUCT_OPS(qmap_cgroup_set_bandwidth, struct cgroup *cgrp, - u64 period_us, u64 quota_us, u64 burst_us) +void BPF_STRUCT_OPS(qmap_cpuctl_set_bandwidth, struct cgroup *cgrp, u64 period_us, + u64 quota_us, u64 burst_us) { if (print_msgs) bpf_printk("CGRP SET %llu period=%lu quota=%ld burst=%lu", cgrp->kn->id, period_us, quota_us, burst_us); } -void BPF_STRUCT_OPS(qmap_cgroup_move, struct task_struct *p, - struct cgroup *from, struct cgroup *to) +void BPF_STRUCT_OPS(qmap_cpuctl_move, struct task_struct *p, struct cgroup *from, + struct cgroup *to) { if (print_msgs) bpf_printk("CGRP MOVE %d %llu -> %llu", @@ -1890,7 +1890,7 @@ void BPF_STRUCT_OPS(qmap_exit, struct scx_exit_info *ei) /* * Seed a new sub slot with the cgroup's current weight. The kernel delivers - * ops.cgroup_set_weight() only on value-changing writes, so a weight set + * ops.cpuctl_set_weight() only on value-changing writes, so a weight set * before the sub attached would otherwise go unnoticed. */ static u32 cgrp_cur_weight(u64 cgid) @@ -1989,10 +1989,10 @@ SCX_OPS_CID_DEFINE(qmap_ops, .dump = (void *)qmap_dump, .dump_cid = (void *)qmap_dump_cid, .dump_task = (void *)qmap_dump_task, - .cgroup_init = (void *)qmap_cgroup_init, - .cgroup_set_weight = (void *)qmap_cgroup_set_weight, - .cgroup_set_bandwidth = (void *)qmap_cgroup_set_bandwidth, - .cgroup_move = (void *)qmap_cgroup_move, + .cpuctl_init = (void *)qmap_cpuctl_init, + .cpuctl_set_weight = (void *)qmap_cpuctl_set_weight, + .cpuctl_set_bandwidth = (void *)qmap_cpuctl_set_bandwidth, + .cpuctl_move = (void *)qmap_cpuctl_move, .sub_attach = (void *)qmap_sub_attach, .sub_detach = (void *)qmap_sub_detach, .sub_caps_updated = (void *)qmap_sub_caps_updated, diff --git a/tools/sched_ext/scx_qmap.c b/tools/sched_ext/scx_qmap.c index ddb524b4946c..27ffda1c519e 100644 --- a/tools/sched_ext/scx_qmap.c +++ b/tools/sched_ext/scx_qmap.c @@ -70,7 +70,7 @@ const char help_fmt[] = " -i SEC Stats interval, seconds (default 5)\n" " -R MS Round-robin period for time-shared cpus, ms (default 200)\n" " -J MODE Fault injection (wrong-cid: dispatch to a cid not held,\n" -" init-fail/cgrp-init-fail: fail init_task/cgroup_init for\n" +" init-fail/cgrp-init-fail: fail init_task/cpuctl_init for\n" " \"qmfail*\" comms/cgroups)\n" " -v Print libbpf debug messages\n" " -h Display this help and exit\n"; diff --git a/tools/sched_ext/scx_qmap.h b/tools/sched_ext/scx_qmap.h index cc2840e7aa3c..c42f7ef74b89 100644 --- a/tools/sched_ext/scx_qmap.h +++ b/tools/sched_ext/scx_qmap.h @@ -65,7 +65,7 @@ enum qmap_inject { QMAP_INJ_OFF = 0, QMAP_INJ_WRONG_CID = 1, /* dispatch to a cid we don't hold */ QMAP_INJ_INIT_FAIL = 2, /* fail init_task for "qmfail*" comms */ - QMAP_INJ_CGRP_INIT_FAIL = 3, /* fail cgroup_init for "qmfail*" cgroups */ + QMAP_INJ_CGRP_INIT_FAIL = 3, /* fail cpuctl_init for "qmfail*" cgroups */ }; /* |
