Skip to content

Commit e776b26

Browse files
committed
sched_ext: Remove cpu.weight / cpu.idle unimplemented warnings
sched_ext generates warnings when cpu.weight / cpu.idle are set to non-default values if the BPF scheduler doesn't implement weight support. These warnings don't provide much value while adding constant annoyance. A BPF scheduler may not implement any particular behavior and there's nothing particularly special about missing cgroup weight support. Drop the warnings. Signed-off-by: Tejun Heo <[email protected]>
1 parent 4706830 commit e776b26

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

kernel/sched/ext.c

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3899,35 +3899,6 @@ bool scx_can_stop_tick(struct rq *rq)
38993899

39003900
DEFINE_STATIC_PERCPU_RWSEM(scx_cgroup_rwsem);
39013901
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-
}
39313902

39323903
int scx_tg_online(struct task_group *tg)
39333904
{
@@ -3937,8 +3908,6 @@ int scx_tg_online(struct task_group *tg)
39373908

39383909
percpu_down_read(&scx_cgroup_rwsem);
39393910

3940-
scx_cgroup_warn_missing_weight(tg);
3941-
39423911
if (scx_cgroup_enabled) {
39433912
if (SCX_HAS_OP(cgroup_init)) {
39443913
struct scx_cgroup_init_args args =
@@ -4076,9 +4045,7 @@ void scx_group_set_weight(struct task_group *tg, unsigned long weight)
40764045

40774046
void scx_group_set_idle(struct task_group *tg, bool idle)
40784047
{
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() */
40824049
}
40834050

40844051
static void scx_cgroup_lock(void)
@@ -4272,9 +4239,6 @@ static int scx_cgroup_init(void)
42724239

42734240
percpu_rwsem_assert_held(&scx_cgroup_rwsem);
42744241

4275-
cgroup_warned_missing_weight = false;
4276-
cgroup_warned_missing_idle = false;
4277-
42784242
/*
42794243
* scx_tg_on/offline() are excluded through scx_cgroup_rwsem. If we walk
42804244
* cgroups and init, all online cgroups are initialized.
@@ -4284,9 +4248,6 @@ static int scx_cgroup_init(void)
42844248
struct task_group *tg = css_tg(css);
42854249
struct scx_cgroup_init_args args = { .weight = tg->scx_weight };
42864250

4287-
scx_cgroup_warn_missing_weight(tg);
4288-
scx_cgroup_warn_missing_idle(tg);
4289-
42904251
if ((tg->scx_flags &
42914252
(SCX_TG_ONLINE | SCX_TG_INITED)) != SCX_TG_ONLINE)
42924253
continue;

0 commit comments

Comments
 (0)