Commit 568894e
committed
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 <[email protected]>1 parent 4269c60 commit 568894e
1 file changed
+22
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3706 | 3706 | | |
3707 | 3707 | | |
3708 | 3708 | | |
| 3709 | + | |
3709 | 3710 | | |
3710 | 3711 | | |
3711 | 3712 | | |
| |||
3725 | 3726 | | |
3726 | 3727 | | |
3727 | 3728 | | |
3728 | | - | |
3729 | | - | |
| 3729 | + | |
3730 | 3730 | | |
3731 | 3731 | | |
3732 | 3732 | | |
| |||
3747 | 3747 | | |
3748 | 3748 | | |
3749 | 3749 | | |
3750 | | - | |
3751 | | - | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
3752 | 3754 | | |
3753 | | - | |
3754 | | - | |
3755 | | - | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
3756 | 3761 | | |
3757 | | - | |
3758 | | - | |
3759 | 3762 | | |
3760 | 3763 | | |
3761 | 3764 | | |
| |||
3786 | 3789 | | |
3787 | 3790 | | |
3788 | 3791 | | |
3789 | | - | |
| 3792 | + | |
3790 | 3793 | | |
3791 | 3794 | | |
3792 | 3795 | | |
| |||
3829 | 3832 | | |
3830 | 3833 | | |
3831 | 3834 | | |
3832 | | - | |
| 3835 | + | |
3833 | 3836 | | |
3834 | 3837 | | |
3835 | 3838 | | |
| |||
3865 | 3868 | | |
3866 | 3869 | | |
3867 | 3870 | | |
3868 | | - | |
| 3871 | + | |
3869 | 3872 | | |
3870 | 3873 | | |
3871 | 3874 | | |
| |||
3882 | 3885 | | |
3883 | 3886 | | |
3884 | 3887 | | |
3885 | | - | |
| 3888 | + | |
3886 | 3889 | | |
3887 | 3890 | | |
3888 | 3891 | | |
| |||
4054 | 4057 | | |
4055 | 4058 | | |
4056 | 4059 | | |
| 4060 | + | |
| 4061 | + | |
| 4062 | + | |
4057 | 4063 | | |
4058 | 4064 | | |
4059 | 4065 | | |
| |||
4129 | 4135 | | |
4130 | 4136 | | |
4131 | 4137 | | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
4132 | 4141 | | |
4133 | 4142 | | |
4134 | 4143 | | |
| |||
0 commit comments