diff options
author | Tejun Heo <tj@kernel.org> | 2024-09-27 23:02:40 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2024-09-27 23:02:40 +0300 |
commit | 568894edbe48f0878f787ed533dc9dbfd09c0fbe (patch) | |
tree | 978e049b22c42e08fa61758858b19a2f572727e6 /rust/helpers/helpers.c | |
parent | 4269c603cc26df154e0db303a9347e6ec3cc805e (diff) | |
download | linux-568894edbe48f0878f787ed533dc9dbfd09c0fbe.tar.xz |
sched_ext: Add scx_cgroup_enabled to gate cgroup operations and fix scx_tg_online()
If the BPF scheduler does not implement ops.cgroup_init(), scx_tg_online()
didn't set SCX_TG_INITED which meant that ops.cgroup_exit(), even if
implemented, won't be called from scx_tg_offline(). This is because
SCX_HAS_OP(cgroupt_init) is used to test both whether SCX cgroup operations
are enabled and ops.cgroup_init() exists.
Fix it by introducing a separate bool scx_cgroup_enabled to gate cgroup
operations and use SCX_HAS_OP(cgroup_init) only to test whether
ops.cgroup_init() exists. Make all cgroup operations consistently use
scx_cgroup_enabled to test whether cgroup operations are enabled.
scx_cgroup_enabled is added instead of using scx_enabled() to ease planned
locking updates.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions