All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: venkatesh.pallipadi@intel.com
Cc: Gautham R Shenoy <ego@in.ibm.com>,
	Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Arjan van de Ven <arjan@infradead.org>,
	linux-kernel@vger.kernel.org,
	Suresh Siddha <suresh.b.siddha@intel.com>
Subject: Re: [patch 1/2] sched: Change the nohz ilb logic from pull to push model
Date: Mon, 21 Dec 2009 14:00:36 +0100	[thread overview]
Message-ID: <1261400436.4314.125.camel@laptop> (raw)
In-Reply-To: <1261397595.4314.72.camel@laptop>

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.


  reply	other threads:[~2009-12-21 13:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-11  1:27 [patch 0/2] sched: Change nohz ilb logic from pull to push model venkatesh.pallipadi
2009-12-11  1:27 ` [patch 1/2] sched: Change the " venkatesh.pallipadi
2009-12-14 22:18   ` Peter Zijlstra
2009-12-21 12:13   ` Peter Zijlstra
2009-12-21 13:00     ` Peter Zijlstra [this message]
2009-12-23  0:15     ` Pallipadi, Venkatesh
2009-12-11  1:27 ` [patch 2/2] sched: Scale the nohz_tracker logic by making it per NUMA node venkatesh.pallipadi
2009-12-14 22:21   ` Peter Zijlstra
2009-12-14 22:32     ` Pallipadi, Venkatesh
2009-12-14 22:58       ` Peter Zijlstra
2009-12-15  1:00         ` Pallipadi, Venkatesh
2009-12-15 10:21           ` Peter Zijlstra
2009-12-21 13:11   ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1261400436.4314.125.camel@laptop \
    --to=peterz@infradead.org \
    --cc=arjan@infradead.org \
    --cc=ego@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    --cc=svaidy@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=venkatesh.pallipadi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.