mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org,
	Suresh Siddha <suresh.b.siddha@intel.com>,
	Mike Galbraith <efault@gmx.de>
Subject: Re: [PATCH] sched: remove redundant check in select_task_rq_fair
Date: Tue, 07 Jun 2011 12:09:21 +0200	[thread overview]
Message-ID: <1307441361.2322.239.camel@twins> (raw)
In-Reply-To: <m3hb82aren.fsf@IBM-009124035060.in.ibm.com>

On Tue, 2011-06-07 at 15:34 +0530, Nikunj A. Dadhania wrote:
> On Tue, 07 Jun 2011 11:53:34 +0200, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Tue, 2011-06-07 at 15:18 +0530, Nikunj A. Dadhania wrote:
> > > When balancing for wakeup affinity, a redundant check can removed.
> > 
> > Yes, tempting, but no, now you've got an extra call to wake_affine(),
> > which is more expensive.

> Ah, got that. How about this, it is more readable. Other options would
> be to add a comment.

> -		if (cpu == prev_cpu || wake_affine(affine_sd, p, sync))
> +		if (cpu != prev_cpu && wake_affine(affine_sd, p, sync))
>  			prev_cpu = cpu;

I guess that depends on which way your head is wired and how strong your
boolean algebra is.. Suresh, Mike any preference? I don't much care
either way.

  reply	other threads:[~2011-06-07 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07  9:48 Nikunj A. Dadhania
2011-06-07  9:53 ` Peter Zijlstra
2011-06-07 10:04   ` Nikunj A. Dadhania
2011-06-07 10:09     ` Peter Zijlstra [this message]
2011-06-07 10:20       ` Mike Galbraith

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=1307441361.2322.239.camel@twins \
    --to=peterz@infradead.org \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=suresh.b.siddha@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®