Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1590437

Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too
Date 2017-03-01 17:00 +0100
Message-ID <tgePw-5b2-5@gated-at.bofh.it> (permalink)
References <t1mFj-3bS-9@gated-at.bofh.it> <t1rYl-6ly-13@gated-at.bofh.it> <tdYYy-8q5-11@gated-at.bofh.it> <te265-23e-9@gated-at.bofh.it> <te3lv-323-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 23 Feb 2017 20:45:06 +0530
Pavan Kondeti <pkondeti@codeaurora.org> 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().

Thanks for pointing this out. I was just doing some tests with my
migrate program and it was failing dramatically. Then looking at why,
it appeared to be missing pushes. Putting back in my old patch, fixed
it up.

Peter, do we have a solution for this yet? Are you going to add the one
with the linker magic?

-- Steve

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Pavan Kondeti <pkondeti@codeaurora.org> - 2017-02-23 11:40 +0100
  Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Peter Zijlstra <peterz@infradead.org> - 2017-02-23 15:00 +0100
    Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Pavan Kondeti <pkondeti@codeaurora.org> - 2017-02-23 16:20 +0100
      Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Peter Zijlstra <peterz@infradead.org> - 2017-02-23 16:50 +0100
        Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Peter Zijlstra <peterz@infradead.org> - 2017-02-23 17:40 +0100
          Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Pavan Kondeti <pkondeti@codeaurora.org> - 2017-02-23 18:30 +0100
            Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Peter Zijlstra <peterz@infradead.org> - 2017-02-23 18:50 +0100
              Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Peter Zijlstra <peterz@infradead.org> - 2017-02-23 19:00 +0100
                Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Steven Rostedt <rostedt@goodmis.org> - 2017-02-27 19:20 +0100
      Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Steven Rostedt <rostedt@goodmis.org> - 2017-03-01 17:00 +0100
        Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Steven Rostedt <rostedt@goodmis.org> - 2017-03-01 17:30 +0100
          Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Peter Zijlstra <peterz@infradead.org> - 2017-03-01 17:50 +0100
        Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too Peter Zijlstra <peterz@infradead.org> - 2017-03-01 17:50 +0100

csiph-web