All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Michael Wang <wangyun@linux.vnet.ibm.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	tglx@linutronix.de
Subject: Re: [RFC 2/2] sched/fair: prefer a CPU in the "lowest" idle state
Date: Thu, 31 Jan 2013 15:58:38 +0900	[thread overview]
Message-ID: <87txpxu9cx.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <510A1198.2070803@linux.vnet.ibm.com> (Michael Wang's message of "Thu, 31 Jan 2013 14:39:20 +0800")

On Thu, 31 Jan 2013 14:39:20 +0800, Michael Wang wrote:
> On 01/31/2013 01:16 PM, Namhyung Kim wrote:
>> Anyway, I have an idea with this in mind.  It's like adding a new "idle
>> load" to each idle cpu rather than special casing the idle cpus like
>> above.  IOW an idle cpu will get very small load weight depends on how
>> deep it's slept so that it can be compared to other cpus in a same way
>> but we can find prefered (lowest load) cpu among the idle cpus.
>> 
>> The simple way I can think of is adding idle_level to a rq load in
>> weighted_cpuload():
>> 
>> static unsigned long weighted_cpuload(const int cpu)
>> {
>> 	return cpu_rq(cpu)->load.weight + cpuidle_get_state(cpu);
>> }
>
> Hmm... then we don't need changes in find_idlest_cpu(), just compare the
> load as before, but it works only when the appendix state value is
> smaller than the lowest load of one task, which is 15 currently, I'm not
> sure whether we have the promise...

You said about a nice 19 process, right?  But I found that SCHED_IDLE
task will have weight of 3. :(

  #define WEIGHT_IDLEPRIO                3


But AFAIK the number of states in cpuidle is usually less than 10 so maybe
we can change the weight then, but there's no promise...

Thanks,
Namhyung

  reply	other threads:[~2013-01-31  6:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 21:19 [RFC] Consider CPU idle state while choosing a new CPU Sebastian Andrzej Siewior
2013-01-30 21:19 ` [RFC 1/2] cpuidle: trace state of the CPU Sebastian Andrzej Siewior
2013-01-31  5:21   ` Namhyung Kim
2013-02-02 17:35     ` Sebastian Andrzej Siewior
2013-01-30 21:19 ` [RFC 2/2] sched/fair: prefer a CPU in the "lowest" idle state Sebastian Andrzej Siewior
2013-01-31  2:12   ` Michael Wang
2013-01-31  5:16     ` Namhyung Kim
2013-01-31  6:39       ` Michael Wang
2013-01-31  6:58         ` Namhyung Kim [this message]
2013-01-31  7:30           ` Michael Wang
2013-01-31  7:40             ` Namhyung Kim
2013-01-31  8:24               ` Michael Wang
2013-01-31  8:45                 ` Michael Wang
2013-01-31  8:57                   ` Michael Wang
2013-02-01  8:53                     ` Namhyung Kim
2013-02-02 17:50     ` Sebastian Andrzej Siewior
2013-02-04  3:01       ` Michael Wang

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=87txpxu9cx.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --cc=wangyun@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 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.