All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Morten Rasmussen <morten.rasmussen@arm.com>,
	mingo@kernel.org, vincent.guittot@linaro.org,
	preeti@linux.vnet.ibm.com, alex.shi@intel.com, efault@gmx.de,
	pjt@google.com, len.brown@intel.com, corbet@lwn.net,
	akpm@linux-foundation.org, torvalds@linux-foundation.org,
	tglx@linutronix.de, catalin.marinas@arm.com,
	linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org
Subject: Re: [RFC][PATCH 0/9] sched: Power scheduler design proposal
Date: Sat, 13 Jul 2013 09:14:21 -0700	[thread overview]
Message-ID: <51E17CDD.30805@linux.intel.com> (raw)
In-Reply-To: <20130713064909.GW25631@dyad.programming.kicks-ass.net>

On 7/12/2013 11:49 PM, Peter Zijlstra wrote:
> On Tue, Jul 09, 2013 at 04:55:29PM +0100, Morten Rasmussen wrote:
>> Hi,
>>
>> This patch set is an initial prototype aiming at the overall power-aware
>> scheduler design proposal that I previously described
>> <http://permalink.gmane.org/gmane.linux.kernel/1508480>.
>>
>> The patch set introduces a cpu capacity managing 'power scheduler' which lives
>> by the side of the existing (process) scheduler. Its role is to monitor the
>> system load and decide which cpus that should be available to the process
>> scheduler.
>
> Hmm...
>
> This looks like a userspace hotplug deamon approach lifted to kernel space :/
>
> How about instead of layering over the load-balancer to constrain its behaviour
> you change the behaviour to not need constraint? Fix it so it does the right
> thing, instead of limiting it.
>
> I don't think its _that_ hard to make the balancer do packing over spreading.
> The power balance code removed in 8e7fbcbc had things like that (although it
> was broken). And I'm sure I've seen patches over the years that did similar
> things. Didn't Vincent and Alex also do things like that?

a basic "sort left" (e.g. when needing to pick a cpu for a task that is short running,
pick the lowest numbered idle one) will already have the effect of packing in practice.
it's not perfect packing, but on a statistical level it'll be quite good.

(this all assumes relatively idle systems with spare capacity to play with of course..
... but that's the domain where packing plays a role)



> Arjan; from reading your emails you're mostly busy explaining what cannot be
> done. Please explain what _can_ be done and what Intel wants. From what I can
> see you basically promote a max P state max concurrency race to idle FTW.
>

btw one more thing I'd like to get is a communication between the scheduler
and the policy/hardware drivers about task migration.
When a task migrates to another CPU, the statistics that the hardware/driver/policy
were keeping on that target CPU are really not valid anymore in terms of forward
looking predictive power. A communication (API or notification or whatever form it takes)
around this would be quite helpful.
This could be as simple as just setting a flag on the target cpu (in their rq), so that
the next power event (exiting idle, P state evaluation, whatever) the policy code
can flush-and-start-over.


on thinking more about the short running task thing; there is an optimization we currently don't do,
mostly for hyperthreading. (and HT is just one out of a set of cases with similar power behavior)
If we know a task runs briefly AND is not performance critical, it's much much better to place it on
a hyperthreading buddy of an already busy core than it is to place it on an empty core (or to delay it).
Yes a HT pair isn't the same performance as a full core, but in terms of power the 2nd half of a HT pair
is nearly free... so if there's a task that's not performance sensitive (and won't disturb the other task too much,
e.g. runs briefly enough)... it's better to pack onto a core than to spread.
you can generalize this to a class of systems where adding work to a core (read: group of cpus that share resources)
is significantly cheaper than running on a full empty core.

(there is clearly a tradeoff, by sharing resources you also end up reducing performance/efficiency, and that has its
own effect on power, so there is some kind of balance needed and a big enough gain to be worth the loss)


  parent reply	other threads:[~2013-07-13 16:14 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 15:55 [RFC][PATCH 0/9] sched: Power scheduler design proposal Morten Rasmussen
2013-07-09 15:55 ` [RFC][PATCH 1/9] sched: Introduce power scheduler Morten Rasmussen
2013-07-09 16:48   ` Arjan van de Ven
2013-07-10  2:10   ` Arjan van de Ven
2013-07-10 11:11     ` Morten Rasmussen
2013-07-10 11:19       ` Vincent Guittot
2013-07-09 15:55 ` [RFC][PATCH 2/9] sched: Redirect update_cpu_power to sched/power.c Morten Rasmussen
2013-07-09 15:55 ` [RFC][PATCH 3/9] sched: Make select_idle_sibling() skip cpu with a cpu_power of 1 Morten Rasmussen
2013-07-09 15:55 ` [RFC][PATCH 4/9] sched: Make periodic load-balance disregard cpus " Morten Rasmussen
2013-07-09 15:55 ` [RFC][PATCH 5/9] sched: Make idle_balance() skip " Morten Rasmussen
2013-07-09 15:55 ` [RFC][PATCH 6/9] sched: power: add power_domain data structure Morten Rasmussen
2013-07-09 15:55 ` [RFC][PATCH 7/9] sched: power: Add power driver interface Morten Rasmussen
2013-07-09 15:55 ` [RFC][PATCH 8/9] sched: power: Add initial frequency scaling support to power scheduler Morten Rasmussen
2013-07-10 13:10   ` Arjan van de Ven
2013-07-12 12:51     ` Morten Rasmussen
2013-07-12 13:06       ` Catalin Marinas
2013-07-12 15:37       ` Arjan van de Ven
2013-07-09 15:55 ` [RFC][PATCH 9/9] sched: power: cpufreq: Initial schedpower cpufreq governor Morten Rasmussen
2013-07-09 16:58 ` [RFC][PATCH 0/9] sched: Power scheduler design proposal Arjan van de Ven
2013-07-10 11:16   ` Morten Rasmussen
2013-07-10 13:05     ` Arjan van de Ven
2013-07-12 12:46       ` Morten Rasmussen
2013-07-12 15:35         ` Arjan van de Ven
2013-07-12 13:00       ` Catalin Marinas
2013-07-12 15:44         ` Arjan van de Ven
2013-07-11 11:34   ` Preeti U Murthy
2013-07-12 13:48     ` Morten Rasmussen
2013-07-15  3:43       ` Preeti U Murthy
2013-07-15  9:55         ` Catalin Marinas
2013-07-15 15:24           ` Arjan van de Ven
2013-07-12 13:31   ` Catalin Marinas
2013-07-13  6:49 ` Peter Zijlstra
2013-07-13 10:23   ` Catalin Marinas
2013-07-15  7:53     ` Vincent Guittot
2013-07-15 20:39     ` Peter Zijlstra
2013-07-16 12:42       ` Catalin Marinas
2013-07-16 15:23         ` Arjan van de Ven
2013-07-17 14:14           ` Catalin Marinas
2013-07-24 13:50             ` Morten Rasmussen
2013-07-24 15:16               ` Arjan van de Ven
2013-07-24 16:46                 ` Morten Rasmussen
2013-07-24 16:48                   ` Arjan van de Ven
2013-07-25  8:00                     ` Morten Rasmussen
2013-07-13 14:40   ` Arjan van de Ven
2013-07-15 19:59     ` Peter Zijlstra
2013-07-15 20:37       ` Arjan van de Ven
2013-07-15 21:03         ` Peter Zijlstra
2013-07-15 22:46           ` Arjan van de Ven
2013-07-16 20:45             ` David Lang
2013-07-15 20:41       ` Arjan van de Ven
2013-07-15 21:06         ` Peter Zijlstra
2013-07-15 21:12           ` Peter Zijlstra
2013-07-15 22:52             ` Arjan van de Ven
2013-07-16 17:38               ` Peter Zijlstra
2013-07-16 18:44                 ` Arjan van de Ven
2013-07-16 19:21                   ` Peter Zijlstra
2013-07-16 19:57                     ` Arjan van de Ven
2013-07-16 20:17                       ` Peter Zijlstra
2013-07-16 20:21                         ` Arjan van de Ven
2013-07-16 20:32                         ` Arjan van de Ven
2013-07-15 22:46           ` Arjan van de Ven
2013-07-13 16:14   ` Arjan van de Ven [this message]
2013-07-15  2:05     ` Alex Shi
2013-07-24 13:16   ` Morten Rasmussen

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=51E17CDD.30805@linux.intel.com \
    --to=arjan@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@intel.com \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=efault@gmx.de \
    --cc=len.brown@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.guittot@linaro.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 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.