public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Paul Turner <pjt@google.com>
Subject: Re: [PATCH] sched: Check nr_running before calling pick_next_task in schedule().
Date: Sat, 02 Jul 2011 17:35:31 +0200	[thread overview]
Message-ID: <1309620931.3282.4.camel@twins> (raw)
In-Reply-To: <CADZ9YHhmctoO+AZfjDYNHXJ6VO3VSDPHgYOhdoW9oROFrBgBnQ@mail.gmail.com>

On Sat, 2011-07-02 at 20:26 +0600, Rakib Mullick wrote:
> Well, yes - branching seems definitely have some side effects.

It adds the cost of the test as well as a possible branch mis-predict.

> Thinking from UP's perspective, it will only hit slow path -- going
> into idle.

Uhm, no, every time the machine is busy and does a schedule between
tasks you still get to do that extra nr_running test and branch.

>  In that case, that likely branch will just fail. And on an
> UP system that slow path -- going into idle -- is the only way, taking
> the fast path (trying picking a task) isn't the right thing, isn't
> it? 

I'm not at all sure I even understand what you're trying to say. I
really don't understand what's the problem with going the long way with
picking the idle task, the machine is idle, it doesn't have anything
useful to do, who cares.

  reply	other threads:[~2011-07-02 15:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 18:41 [PATCH] sched: Check nr_running before calling pick_next_task in schedule() Rakib Mullick
2011-07-02  2:18 ` Paul Turner
2011-07-02  2:23 ` Paul Turner
2011-07-02  4:37   ` Rakib Mullick
2011-07-02  9:51 ` Peter Zijlstra
2011-07-02 14:26   ` Rakib Mullick
2011-07-02 15:35     ` Peter Zijlstra [this message]
2011-07-03  8:07       ` Rakib Mullick
2011-07-04  9:00         ` Rakib Mullick
2011-07-09  4:43     ` Rakib Mullick

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=1309620931.3282.4.camel@twins \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pjt@google.com \
    --cc=rakib.mullick@gmail.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