Re: [RFC PATCH 07/13] sched: Add core wide task selection and scheduling.

Joel Fernandes
2020-05-22T20:13:17Z

On Fri, May 22, 2020 at 11:44:06AM +0800, Aaron Lu wrote:
[...]
> > Updated diff below:
> >
> > ---8<-----------------------
> >
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index 005d7f7323e2d..625377f393ed3 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -182,9 +182,6 @@ static void sched_core_enqueue(struct rq *rq, struct task_struct *p)
> >
> > rq->core->core_task_seq++;
> >
> > - if (!p->core_cookie)
> > - return;
> > -
> > node = &rq->core_tree.rb_node;
> > parent = *node;
> >
> > @@ -215,7 +212,7 @@ static void sched_core_dequeue(struct rq *rq, struct task_struct *p)
> >
> > void sched_core_add(struct rq *rq, struct task_struct *p)
> > {
> > - if (p->core_cookie && task_on_rq_queued(p))
> > + if (task_on_rq_queued(p))
> > sched_core_enqueue(rq, p);
> > }
>
> It appears there are other call sites of sched_core_enqueue() where
> core_cookie is checked: cpu_cgroup_fork() and __sched_write_tag().

Thanks, but looks like pick_task()'s caller also makes various assumptions
about cookie == 0 so all that needs to be vetted again I think.

- Joel