Re: [RFC PATCH v2 09/17] sched: Introduce sched_class::pick_task()

2019-04-28 Thread Aaron Lu
On Tue, Apr 23, 2019 at 04:18:14PM +, Vineeth Remanan Pillai wrote: > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index c055bad249a9..45d86b862750 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -4132,7 +4132,7 @@ pick_next_entity(struct cfs_rq *cfs_rq, struct

Re: [RFC PATCH v2 09/17] sched: Introduce sched_class::pick_task()

2019-04-26 Thread Vineeth Remanan Pillai
> > I didn't get around to reading the original discussion here, but how can > that possibly be? > > I can see !se, in that case curr is still selected. > > I can also see !curr, in that case curr is put. > > But I cannot see !se && !curr, per the above check we know > cfs_rq->nr_running != 0, so

Re: [RFC PATCH v2 09/17] sched: Introduce sched_class::pick_task()

2019-04-26 Thread Peter Zijlstra
On Tue, Apr 23, 2019 at 04:18:14PM +, Vineeth Remanan Pillai wrote: > +static struct task_struct * > +pick_task_fair(struct rq *rq) > +{ > + struct cfs_rq *cfs_rq = >cfs; > + struct sched_entity *se; > + > + if (!cfs_rq->nr_running) > + return NULL; > + > + do { > +

[RFC PATCH v2 09/17] sched: Introduce sched_class::pick_task()

2019-04-23 Thread Vineeth Remanan Pillai
From: "Peter Zijlstra (Intel)" Because sched_class::pick_next_task() also implies sched_class::set_next_task() (and possibly put_prev_task() and newidle_balance) it is not state invariant. This makes it unsuitable for remote task selection. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: