mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: remove redundant check in select_task_rq_fair
Date: Tue, 07 Jun 2011 15:34:48 +0530	[thread overview]
Message-ID: <m3hb82aren.fsf@IBM-009124035060.in.ibm.com> (raw)
In-Reply-To: <1307440414.2322.236.camel@twins>

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.

Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
---
 kernel/sched_fair.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 433491c..354e26b 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1753,7 +1753,7 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags)
 	}
 
 	if (affine_sd) {
-		if (cpu == prev_cpu || wake_affine(affine_sd, p, sync))
+		if (cpu != prev_cpu && wake_affine(affine_sd, p, sync))
 			prev_cpu = cpu;

  reply	other threads:[~2011-06-07 10:04 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 [this message]
2011-06-07 10:09     ` Peter Zijlstra
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=m3hb82aren.fsf@IBM-009124035060.in.ibm.com \
    --to=nikunj@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /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®