[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150320102733.10316214@gandalf.local.home>
Date: Fri, 20 Mar 2015 10:27:33 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Clark Williams <williams@...hat.com>,
linux-rt-users <linux-rt-users@...r.kernel.org>,
Mike Galbraith <umgwanakikbuti@...il.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Jörn Engel <joern@...estorage.com>
Subject: Re: [PATCH v5] sched/rt: Use IPI to trigger RT task push migration
instead of pulling
On Fri, 20 Mar 2015 11:25:42 +0100
Peter Zijlstra <peterz@...radead.org> wrote:
> On Wed, Mar 18, 2015 at 02:49:46PM -0400, Steven Rostedt wrote:
> > +static int find_next_push_cpu(struct rq *rq)
> > +{
> > + struct rq *next_rq;
> > + int cpu;
> > +
> > + while (1) {
>
> We typically tend to write: for (;;), instead, however would a do { }
> while () loop not make more sense here?
You know, I use to do "for (;;)" instead of "while (1)" because to me
"for (;;)" == "forever". But people have since convinced me that
"while (1)" is better. I don't really care so I just did the switch :-p
>
> do {
> cpu = rto_next_cpu(rq);
> if (cpu >= nr_cpu_ids)
> break;
>
> next_rq = cpu_rq(cpu);
> } while (next_rq->rt.highest_prio.next >= rq->rt.highest_prio.curr);
Ah, that does make sense. Not sure why I had it the way I did. I think
it had to do with the way I thought about the algorithm. I did it in
layers. As there were more than one break, I probably just figured to
do them explicitly.
Want me to send an updated patch?
-- Steve
>
> > + return cpu;
> > +}
--
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