public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikanth Karthikesan <knikanth@suse.de>
To: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Cc: a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org,
	vatsa@linux.vnet.ibm.com, mingo@elte.hu
Subject: Re: [PATCH] sched: minor optimization
Date: Sat, 24 Nov 2007 18:56:13 +0530	[thread overview]
Message-ID: <47482675.80602@suse.de> (raw)

> On Fri, Nov 23, 2007 at  5:48 PM, "Dmitry Adamushko"
<dmitry.adamushko@gmail.com> wrote:
> The only legitimate possibility of having the fair_sched_class
> returning no task in this case is when 'rq->nr_running ==
> rq->cfs.nr_running == 0'.

Yes, I think so.

> iow, a possible optimization would be just the following check :
>
> if (rq->nr_running == 0)
>         return idle_sched_class.pick_next_task(rq);
> at the beginning of pick_next_task().
>
> (or maybe put it at the beginning of the
> if (likely(rq->nr_running == rq->cfs.nr_running)) {} block as we
> already have 'likely()' there).
>

But that might add a test before the case we want to optimize the most.
I just thought of taking advantage of a case where we know
rq->nr_running==0, instead of throwing away that information.

Thanks
Nikanth

             reply	other threads:[~2007-11-23 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-24 13:26 Nikanth Karthikesan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-11-24 11:46 [PATCH] sched: minor optimization Nikanth Karthikesan
2007-11-23 12:18 ` Dmitry Adamushko

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=47482675.80602@suse.de \
    --to=knikanth@suse.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=dmitry.adamushko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=vatsa@linux.vnet.ibm.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