[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPJCdB=f_qSS-t_TFSjtT9uDo6q57bScCyau=gkF4E1gNcSjmQ@mail.gmail.com>
Date: Thu, 20 Aug 2020 22:19:32 +0800
From: Jiang Biao <benbjiang@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Vincent Guittot <vincent.guittot@...aro.org>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
linux-kernel <linux-kernel@...r.kernel.org>,
Jiang Biao <benbjiang@...cent.com>
Subject: Re: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task
On Thu, 20 Aug 2020 at 20:58, <peterz@...radead.org> wrote:
>
> On Thu, Aug 20, 2020 at 02:51:06PM +0200, Vincent Guittot wrote:
> > On Thu, 20 Aug 2020 at 14:00, Jiang Biao <benbjiang@...il.com> wrote:
> > >
> > > From: Jiang Biao <benbjiang@...cent.com>
> > >
> > > Vruntime compensation has been down in place_entity() to
> > > boot the waking procedure for fair tasks. There is no need to
> >
> > s/boot/boost/ ?
> >
> > > do that for SCHED_IDLE task actually.
> > >
> > > Not compensating vruntime for SCHED_IDLE task could make
> > > SCHED_IDLE task more harmless for normal tasks.
>
> This is rather week. It would be much better if there's some actual data
> to support this claim.
I'll try to have a test and get some data. :)
>
> > > Signed-off-by: Jiang Biao <benbjiang@...cent.com>
> > > ---
> > > kernel/sched/fair.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > > index 1a68a0536add..adff77676a0a 100644
> > > --- a/kernel/sched/fair.c
> > > +++ b/kernel/sched/fair.c
> > > @@ -4115,7 +4115,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
> > > vruntime += sched_vslice(cfs_rq, se);
> > >
> > > /* sleeps up to a single latency don't count. */
> > > - if (!initial) {
> > > + if (!initial && likely(!task_has_idle_policy(task_of(se)))) {
> >
> > What if se is not a task ?
>
> Then we very much need it, because it might have fair tasks inside. I
> suppose you could do something complicated with idle_h_nr_running, but
> is all that really worth the effort?
Would it be better to limit to task se case? like
+ if (!initial && likely(!entity_is_task(se) ||
!task_has_idle_policy(task_of(se)))) {
>
> > > unsigned long thresh = sysctl_sched_latency;
> > >
> > > /*
> > > --
> > > 2.21.0
> > >
Powered by blists - more mailing lists