lkml.org 
[lkml]   [2009]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 1/2] sched: Change the nohz ilb logic from pull to push model
FromPeter Zijlstra <>
DateMon, 21 Dec 2009 14:00:36 +0100
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.



\
 
 \ /
  Last update: 2009-12-21 14:03    [from the cache]
©2003-2010