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

From: Tao Zhou
Date: Mon Aug 23 2021 - 18:45:00 EST


Hi Josh,

On Mon, Aug 23, 2021 at 10:29:53AM -0700, Josh Don wrote:
> 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.

Yes. If the compile align the stack to 8 or other, this will have
no effect(I've not check this, and have not much about gcc compile
align). I just presume that if the stack can save 4 bytes. But,
that may not right though.

> - Josh



Thanks,
Tao