[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1261400436.4314.125.camel@laptop>
Date: Mon, 21 Dec 2009 14:00:36 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: venkatesh.pallipadi@...el.com
Cc: Gautham R Shenoy <ego@...ibm.com>,
Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Arjan van de Ven <arjan@...radead.org>,
linux-kernel@...r.kernel.org,
Suresh Siddha <suresh.b.siddha@...el.com>
Subject: Re: [patch 1/2] sched: Change the nohz ilb logic from pull to push
model
On Mon, 2009-12-21 at 13:13 +0100, Peter Zijlstra wrote:
>
> > + ret = atomic_cmpxchg(&nohz.first_pick_cpu, -1, cpu);
> > + if (ret == -1 || ret == cpu) {
> > + atomic_cmpxchg(&nohz.second_pick_cpu, cpu, -1);
> > + if (rq->nr_running > 1)
> > + return 1;
> > + } else {
> > + ret = atomic_cmpxchg(&nohz.second_pick_cpu, -1, cpu);
> > + if (ret == -1 || ret == cpu) {
> > + if (rq->nr_running)
> > + return 1;
> > }
> > }
>
> Looked very funny, and took a while to understand why you're doing that,
> but yeah, I can't see a better way of doing it either.
That is, the sanest way to write that is to do something like:
weight(~nohz & online) == 1 && nr_running == 1
except that with the recent cpumask blowout that's a very expensive op.
--
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