@@ -163,7 +163,7 @@ enum scx_ops_flags {
163
163
/*
164
164
* CPU cgroup support flags
165
165
*/
166
- SCX_OPS_HAS_CGROUP_WEIGHT = 1LLU << 16 , /* cpu.weight */
166
+ SCX_OPS_HAS_CGROUP_WEIGHT = 1LLU << 16 , /* DEPRECATED, will be removed on 6.18 */
167
167
168
168
SCX_OPS_ALL_FLAGS = SCX_OPS_KEEP_BUILTIN_IDLE |
169
169
SCX_OPS_ENQ_LAST |
@@ -3899,35 +3899,6 @@ bool scx_can_stop_tick(struct rq *rq)
3899
3899
3900
3900
DEFINE_STATIC_PERCPU_RWSEM (scx_cgroup_rwsem );
3901
3901
static bool scx_cgroup_enabled ;
3902
- static bool cgroup_warned_missing_weight ;
3903
- static bool cgroup_warned_missing_idle ;
3904
-
3905
- static void scx_cgroup_warn_missing_weight (struct task_group * tg )
3906
- {
3907
- if (scx_ops_enable_state () == SCX_OPS_DISABLED ||
3908
- cgroup_warned_missing_weight )
3909
- return ;
3910
-
3911
- if ((scx_ops .flags & SCX_OPS_HAS_CGROUP_WEIGHT ) || !tg -> css .parent )
3912
- return ;
3913
-
3914
- pr_warn ("sched_ext: \"%s\" does not implement cgroup cpu.weight\n" ,
3915
- scx_ops .name );
3916
- cgroup_warned_missing_weight = true;
3917
- }
3918
-
3919
- static void scx_cgroup_warn_missing_idle (struct task_group * tg )
3920
- {
3921
- if (!scx_cgroup_enabled || cgroup_warned_missing_idle )
3922
- return ;
3923
-
3924
- if (!tg -> idle )
3925
- return ;
3926
-
3927
- pr_warn ("sched_ext: \"%s\" does not implement cgroup cpu.idle\n" ,
3928
- scx_ops .name );
3929
- cgroup_warned_missing_idle = true;
3930
- }
3931
3902
3932
3903
int scx_tg_online (struct task_group * tg )
3933
3904
{
@@ -3937,8 +3908,6 @@ int scx_tg_online(struct task_group *tg)
3937
3908
3938
3909
percpu_down_read (& scx_cgroup_rwsem );
3939
3910
3940
- scx_cgroup_warn_missing_weight (tg );
3941
-
3942
3911
if (scx_cgroup_enabled ) {
3943
3912
if (SCX_HAS_OP (cgroup_init )) {
3944
3913
struct scx_cgroup_init_args args =
@@ -4076,9 +4045,7 @@ void scx_group_set_weight(struct task_group *tg, unsigned long weight)
4076
4045
4077
4046
void scx_group_set_idle (struct task_group * tg , bool idle )
4078
4047
{
4079
- percpu_down_read (& scx_cgroup_rwsem );
4080
- scx_cgroup_warn_missing_idle (tg );
4081
- percpu_up_read (& scx_cgroup_rwsem );
4048
+ /* TODO: Implement ops->cgroup_set_idle() */
4082
4049
}
4083
4050
4084
4051
static void scx_cgroup_lock (void )
@@ -4272,9 +4239,6 @@ static int scx_cgroup_init(void)
4272
4239
4273
4240
percpu_rwsem_assert_held (& scx_cgroup_rwsem );
4274
4241
4275
- cgroup_warned_missing_weight = false;
4276
- cgroup_warned_missing_idle = false;
4277
-
4278
4242
/*
4279
4243
* scx_tg_on/offline() are excluded through scx_cgroup_rwsem. If we walk
4280
4244
* cgroups and init, all online cgroups are initialized.
@@ -4284,9 +4248,6 @@ static int scx_cgroup_init(void)
4284
4248
struct task_group * tg = css_tg (css );
4285
4249
struct scx_cgroup_init_args args = { .weight = tg -> scx_weight };
4286
4250
4287
- scx_cgroup_warn_missing_weight (tg );
4288
- scx_cgroup_warn_missing_idle (tg );
4289
-
4290
4251
if ((tg -> scx_flags &
4291
4252
(SCX_TG_ONLINE | SCX_TG_INITED )) != SCX_TG_ONLINE )
4292
4253
continue ;
@@ -4623,7 +4584,7 @@ static void scx_ops_bypass(bool bypass)
4623
4584
4624
4585
static void free_exit_info (struct scx_exit_info * ei )
4625
4586
{
4626
- kfree (ei -> dump );
4587
+ kvfree (ei -> dump );
4627
4588
kfree (ei -> msg );
4628
4589
kfree (ei -> bt );
4629
4590
kfree (ei );
@@ -4639,7 +4600,7 @@ static struct scx_exit_info *alloc_exit_info(size_t exit_dump_len)
4639
4600
4640
4601
ei -> bt = kcalloc (SCX_EXIT_BT_LEN , sizeof (ei -> bt [0 ]), GFP_KERNEL );
4641
4602
ei -> msg = kzalloc (SCX_EXIT_MSG_LEN , GFP_KERNEL );
4642
- ei -> dump = kzalloc (exit_dump_len , GFP_KERNEL );
4603
+ ei -> dump = kvzalloc (exit_dump_len , GFP_KERNEL );
4643
4604
4644
4605
if (!ei -> bt || !ei -> msg || !ei -> dump ) {
4645
4606
free_exit_info (ei );
@@ -5252,6 +5213,9 @@ static int validate_ops(const struct sched_ext_ops *ops)
5252
5213
return - EINVAL ;
5253
5214
}
5254
5215
5216
+ if (ops -> flags & SCX_OPS_HAS_CGROUP_WEIGHT )
5217
+ pr_warn ("SCX_OPS_HAS_CGROUP_WEIGHT is deprecated and a noop\n" );
5218
+
5255
5219
return 0 ;
5256
5220
}
5257
5221
0 commit comments