[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140217112420.GD15586@twins.programming.kicks-ass.net>
Date: Mon, 17 Feb 2014 12:24:20 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Michael wang <wangyun@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Juri Lelli <juri.lelli@...il.com>
Subject: Re: [RFC PATCH] sched: make sure sched-priority after invoke
idle_balance()
On Mon, Feb 17, 2014 at 11:31:16AM +0800, Michael wang wrote:
> > pick_next_task(struct rq *rq, struct task_struct *prev)
> > {
> > - const struct sched_class *class;
> > + const struct sched_class *class = &fair_sched_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 == &fair_sched_class &&
> > + if (likely(prev->sched_class == class &&
> > rq->nr_running == rq->cfs.h_nr_running)) {
> > p = fair_sched_class.pick_next_task(rq, prev);
> > if (likely(p))
> > - return p;
> > + goto got_task;
>
> Since idle_balance() won't happen in the loop, may be we could use:
>
> if p && p->sched_class == class
> return p
>
> in here, let it fall down into the loop if p is idle, since that means
> we got RT/DL and will do this anyway, could save two jump work may be?
> (and may could combine some code below if so?)
Maybe; we'd have to look at whatever GCC does with it. But yes I think I
like the code better that way.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists