Re: [PATCH v3 1/4] sched: cgroup SCHED_IDLE support

From: Josh Don
Date: Mon Aug 23 2021 - 13:30:10 EST


Hi Tao,

On Fri, Aug 20, 2021 at 1:38 AM Tao Zhou <tao.zhou@xxxxxxxxx> wrote:
[snip]
> > #ifdef CONFIG_SMP
> > extern void set_task_rq_fair(struct sched_entity *se,
> > struct cfs_rq *prev, struct cfs_rq *next);
> > @@ -601,6 +606,9 @@ struct cfs_rq {
> > struct list_head leaf_cfs_rq_list;
> > struct task_group *tg; /* group that "owns" this runqueue */
> >
> > + /* Locally cached copy of our task_group's idle value */
> > + int idle;
> > +
> > #ifdef CONFIG_CFS_BANDWIDTH
> > int runtime_enabled;
> > s64 runtime_remaining;
> > --
> > 2.33.0.rc2.250.ged5fa647cd-goog
> >
>
> Cfs_rq and tg define @idle with int type.
> In sched_group_set_idle(..., long idle), @idle is long type.
> Use int instead.
>
> But, you filter idle value:
>
> if (idle < 0 || idle > 1)
> return -EINVAL;
>
> So, no effect here.. Just @idle can use 4 bytes.
>
>
>
> Thanks,
> Tao

The use of 'long' there is because the input from the cgroup
interface is a 64 bit value.

- Josh