All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Pavan Kondeti <pkondeti@codeaurora.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too
Date: Thu, 23 Feb 2017 16:25:33 +0100	[thread overview]
Message-ID: <20170223152533.GG6515@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAEU1=Pk=ZvePRg2pH34akgRjPHCeaKU66GUtw2Q65tOAx920ng@mail.gmail.com>

On Thu, Feb 23, 2017 at 08:45:06PM +0530, Pavan Kondeti wrote:
> Hi Peter,
> 
> On Thu, Feb 23, 2017 at 7:24 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Thu, Feb 23, 2017 at 04:04:22PM +0530, Pavan Kondeti wrote:
> >> Hi Peter,
> >>
> >> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> >> > index 49ce1cb..51ca21e 100644
> >> > --- a/kernel/sched/core.c
> >> > +++ b/kernel/sched/core.c
> >> > @@ -3321,15 +3321,14 @@ static inline void schedule_debug(struct task_struct *prev)
> >> >  static inline struct task_struct *
> >> >  pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
> >> >  {
> >> > -       const struct sched_class *class = &fair_sched_class;
> >> > +       const struct sched_class *class;
> >> >         struct task_struct *p;
> >> >
> >> >         /*
> >> >          * Optimization: we know that if all tasks are in
> >> >          * the fair class we can call that function directly:
> >> >          */
> >> > -       if (likely(prev->sched_class == class &&
> >> > -                  rq->nr_running == rq->cfs.h_nr_running)) {
> >> > +       if (likely(rq->nr_running == rq->cfs.h_nr_running)) {
> >> >                 p = fair_sched_class.pick_next_task(rq, prev, rf);
> >> >                 if (unlikely(p == RETRY_TASK))
> >> >                         goto again;
> >>
> >> Would this delay pulling RT tasks from other CPUs? Lets say this CPU
> >> has 2 fair tasks and 1 RT task. The RT task is sleeping now. Earlier,
> >> we attempt to pull RT tasks from other CPUs in pick_next_task_rt(),
> >> which is not done anymore.
> >
> > It should not; the two places of interrests are when we leave the RT
> > class to run anything lower (fair,idle), at which point we'll pull,
> > or when an RT tasks wakes up, at which point it'll push.
> 
> Can you kindly show me where we are pulling when a RT task goes to
> sleep? Apart from class/prio change, I see pull happening only from
> pick_next_task_rt().

Ah, I read your question wrong. Yes I think you're right, we now loose
the pull when the last RT task goes away.

Hmm.. how to fix that nicely..

  reply	other threads:[~2017-02-23 15:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 15:17 [PATCH] sched: Optimize pick_next_task for idle_sched_class too Steven Rostedt
2017-01-19 17:44 ` Peter Zijlstra
2017-01-20 16:14   ` Steven Rostedt
2017-01-20 16:16     ` Steven Rostedt
2017-01-20 16:52     ` Peter Zijlstra
2017-01-30 11:54   ` [tip:sched/core] sched/core: Optimize pick_next_task() for idle_sched_class tip-bot for Peter Zijlstra
2017-02-23 10:34   ` [PATCH] sched: Optimize pick_next_task for idle_sched_class too Pavan Kondeti
2017-02-23 13:54     ` Peter Zijlstra
2017-02-23 15:15       ` Pavan Kondeti
2017-02-23 15:25         ` Peter Zijlstra [this message]
2017-02-23 16:37           ` Peter Zijlstra
2017-02-23 17:29             ` Pavan Kondeti
2017-02-23 17:45               ` Peter Zijlstra
2017-02-23 17:54                 ` Peter Zijlstra
2017-02-27 17:54                   ` Steven Rostedt
2017-03-01 15:53         ` Steven Rostedt
2017-03-01 16:03           ` Peter Zijlstra
2017-03-01 16:19             ` Steven Rostedt
2017-03-01 16:22               ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170223152533.GG6515@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pkondeti@codeaurora.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.