From: Catalin Marinas <catalin.marinas@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>, Paul Turner <pjt@google.com>,
Morten Rasmussen <Morten.Rasmussen@arm.com>,
Chris Metcalf <cmetcalf@tilera.com>,
Tony Luck <tony.luck@intel.com>,
"alex.shi@intel.com" <alex.shi@intel.com>,
Preeti U Murthy <preeti@linux.vnet.ibm.com>,
linaro-kernel <linaro-kernel@lists.linaro.org>,
"len.brown@intel.com" <len.brown@intel.com>,
"l.majewski@samsung.com" <l.majewski@samsung.com>,
Jonathan Corbet <corbet@lwn.net>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Paul McKenney <paulmck@linux.vnet.ibm.com>,
Arjan van de Ven <arjan@linux.intel.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: [RFC][PATCH v5 00/14] sched: packing tasks
Date: Tue, 12 Nov 2013 17:40:28 +0000 [thread overview]
Message-ID: <20131112174028.GC30177@arm.com> (raw)
In-Reply-To: <20131111163630.GD26898@twins.programming.kicks-ass.net>
On Mon, Nov 11, 2013 at 04:36:30PM +0000, Peter Zijlstra wrote:
> On Mon, Nov 11, 2013 at 11:33:45AM +0000, Catalin Marinas wrote:
>
> tl;dr :-) Still trying to wrap my head around how to do that weird
> topology Vincent raised..
Long email, I know, but topology discussion is a good start ;).
To summarise the rest, I don't see full task packing as useful but
rather getting packing as a result of other decisions (like trying to
estimate the cost of task placement and refining the algorithm from
there). There are ARM SoCs where maximising idle time does not always
mean maximising the energy saving even if the cores can be power-gated
individually (unless you have small workload that doesn't increase the
P-state on the packing CPU).
> > Question for Peter/Ingo: do you want the scheduler to decide on which
> > C-state a CPU should be in or we still leave this to a cpuidle
> > layer/driver?
>
> I think the can leave most of that in a driver; right along with how to
> prod the hardware to actually get into that state.
>
> I think the most important parts are what is now 'generic' code; stuff
> that guestimates the idle-time and so forth.
>
> I think the scheduler simply wants to say: we expect to go idle for X
> ns, we want a guaranteed wakeup latency of Y ns -- go do your thing.
Sounds good (and I think the Linaro guys started looking into this).
> I think you also raised the point in that we do want some feedback as to
> the cost of waking up particular cores to better make decisions on which
> to wake. That is indeed so.
It depends on how we end up implementing the energy awareness in the
scheduler but too simple topology (just which CPUs can be power-gated)
is not that useful.
In a very simplistic and ideal world (note the 'ideal' part), we could
estimate the energy cost of a CPU for a period T:
E = sum(P(Cx) * Tx) + sum(wake-up-energy) + sum(P(Ty) * Ty)
P(Cx): power in C-state x
wake-up-energy: the cost of waking up from various C-states
P(Ty): power of running task y (which also depends on the P-state)
sum(Tx) + sum(Ty) = T
Assuming that we have such information and can predict (based on past
usage) what the task loads will be, together with other
performance/latency constraints, an 'ideal' scheduler would always
choose the correct C/P states and task placements for optimal energy.
However, the reality is different and even so it would be an NP problem.
But we can try to come up with some "guestimates" based on parameters
provided by the SoC (via DT or ACPI tables or just some low-level
driver/arch code). The scheduler does its best according on these
parameters at certain times (task wake-up, idle balance) while the SoC
can still tune the behaviour.
If we roughly estimate the energy cost of a run-queue and the energy
cost of individual tasks on that run-queue (based on their load and
P-state), we could estimate the cost of moving or waking the
task on another CPU (where the task's cost may change depending on
asymmetric configurations or different P-state). We don't even need to
be precise in the energy costs but just some relative numbers so that
the scheduler can favour one CPU or another. If we ignore P-state costs
and only consider C-states and symmetric configurations, we probably get
a behaviour similar to Vincent's task packing patches.
The information we have currently for C-states is target residency and
exit latency. From these I think we can only infer the wake-up energy
cost not how much we save but placing a CPU into that state. So if we
want the scheduler to decide whether to pack or spread (from an energy
cost perspective), we need additional information in the topology.
Alternatively we could have a power driver which dynamically returns
some estimates every time the scheduler asks for them, with a power
driver for each SoC (which is already the case for ARM SoCs).
--
Catalin
next prev parent reply other threads:[~2013-11-12 17:41 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-18 11:52 [RFC][PATCH v5 00/14] sched: packing tasks Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 01/14] sched: add a new arch_sd_local_flags for sched_domain init Vincent Guittot
2013-11-05 14:06 ` Peter Zijlstra
2013-11-05 14:57 ` Vincent Guittot
2013-11-05 22:27 ` Peter Zijlstra
2013-11-06 10:10 ` Vincent Guittot
2013-11-06 13:53 ` Martin Schwidefsky
2013-11-06 14:08 ` Peter Zijlstra
2013-11-12 17:43 ` Dietmar Eggemann
2013-11-12 18:08 ` Peter Zijlstra
2013-11-13 15:47 ` Dietmar Eggemann
2013-11-13 16:29 ` Peter Zijlstra
2013-11-14 10:49 ` Morten Rasmussen
2013-11-14 12:07 ` Peter Zijlstra
2013-12-18 13:13 ` [RFC] sched: CPU topology try Vincent Guittot
2013-12-23 17:22 ` Dietmar Eggemann
2014-01-06 13:41 ` Vincent Guittot
2014-01-06 16:31 ` Peter Zijlstra
2014-01-07 8:32 ` Vincent Guittot
2014-01-07 13:22 ` Peter Zijlstra
2014-01-07 14:10 ` Peter Zijlstra
2014-01-07 15:41 ` Morten Rasmussen
2014-01-07 20:49 ` Peter Zijlstra
2014-01-08 8:32 ` Alex Shi
2014-01-08 8:37 ` Peter Zijlstra
2014-01-08 12:52 ` Morten Rasmussen
2014-01-08 13:04 ` Peter Zijlstra
2014-01-08 13:33 ` Morten Rasmussen
2014-01-08 12:35 ` Morten Rasmussen
2014-01-08 12:42 ` Peter Zijlstra
2014-01-08 12:45 ` Peter Zijlstra
2014-01-08 13:27 ` Morten Rasmussen
2014-01-08 13:32 ` Peter Zijlstra
2014-01-08 13:45 ` Morten Rasmussen
2014-01-07 14:11 ` Vincent Guittot
2014-01-07 15:37 ` Morten Rasmussen
2014-01-08 8:37 ` Alex Shi
2014-01-06 16:28 ` Peter Zijlstra
2014-01-06 17:15 ` Morten Rasmussen
2014-01-07 9:57 ` Peter Zijlstra
2014-01-01 5:00 ` Preeti U Murthy
2014-01-06 16:33 ` Peter Zijlstra
2014-01-06 16:37 ` Arjan van de Ven
2014-01-06 16:48 ` Peter Zijlstra
2014-01-06 16:54 ` Peter Zijlstra
2014-01-06 17:13 ` Arjan van de Ven
2014-01-07 12:40 ` Vincent Guittot
2014-01-06 16:21 ` Peter Zijlstra
2014-01-07 8:22 ` Vincent Guittot
2014-01-07 9:40 ` Preeti U Murthy
2014-01-07 9:50 ` Peter Zijlstra
2014-01-07 10:39 ` Preeti U Murthy
2014-01-07 11:13 ` Peter Zijlstra
2014-01-07 16:31 ` Preeti U Murthy
2014-01-07 11:20 ` Morten Rasmussen
2014-01-07 12:31 ` Vincent Guittot
2014-01-07 16:51 ` Preeti U Murthy
2013-10-18 11:52 ` [RFC][PATCH v5 03/14] sched: define pack buddy CPUs Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 04/14] sched: do load balance only with packing cpus Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 05/14] sched: add a packing level knob Vincent Guittot
2013-11-12 10:32 ` Peter Zijlstra
2013-11-12 10:44 ` Vincent Guittot
2013-11-12 10:55 ` Peter Zijlstra
2013-11-12 10:57 ` Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 06/14] sched: create a new field with available capacity Vincent Guittot
2013-11-12 10:34 ` Peter Zijlstra
2013-11-12 11:05 ` Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 07/14] sched: get CPU's activity statistic Vincent Guittot
2013-11-12 10:36 ` Peter Zijlstra
2013-11-12 10:41 ` Peter Zijlstra
2013-10-18 11:52 ` [RFC][PATCH v5 08/14] sched: move load idx selection in find_idlest_group Vincent Guittot
2013-11-12 10:49 ` Peter Zijlstra
2013-11-27 14:10 ` [tip:sched/core] sched/fair: Move " tip-bot for Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 09/14] sched: update the packing cpu list Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 10/14] sched: init this_load to max in find_idlest_group Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 11/14] sched: add a SCHED_PACKING_TASKS config Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 12/14] sched: create a statistic structure Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 13/14] sched: differantiate idle cpu Vincent Guittot
2013-10-18 11:52 ` [RFC][PATCH v5 14/14] cpuidle: set the current wake up latency Vincent Guittot
2013-11-11 11:33 ` [RFC][PATCH v5 00/14] sched: packing tasks Catalin Marinas
2013-11-11 16:36 ` Peter Zijlstra
2013-11-11 16:39 ` Arjan van de Ven
2013-11-11 18:18 ` Catalin Marinas
2013-11-11 18:20 ` Arjan van de Ven
2013-11-12 12:06 ` Morten Rasmussen
2013-11-12 16:48 ` Arjan van de Ven
2013-11-12 23:14 ` Catalin Marinas
2013-11-13 16:13 ` Arjan van de Ven
2013-11-13 16:45 ` Catalin Marinas
2013-11-13 17:56 ` Arjan van de Ven
2013-11-12 17:40 ` Catalin Marinas [this message]
2013-11-25 18:55 ` Daniel Lezcano
2013-11-11 16:38 ` Peter Zijlstra
2013-11-11 16:40 ` Arjan van de Ven
2013-11-12 10:36 ` Vincent Guittot
2013-11-11 16:54 ` Morten Rasmussen
2013-11-11 18:31 ` Catalin Marinas
2013-11-11 19:26 ` Arjan van de Ven
2013-11-11 22:43 ` Nicolas Pitre
2013-11-11 23:43 ` Catalin Marinas
2013-11-12 12:35 ` Vincent Guittot
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=20131112174028.GC30177@arm.com \
--to=catalin.marinas@arm.com \
--cc=Morten.Rasmussen@arm.com \
--cc=alex.shi@intel.com \
--cc=arjan@linux.intel.com \
--cc=cmetcalf@tilera.com \
--cc=corbet@lwn.net \
--cc=l.majewski@samsung.com \
--cc=len.brown@intel.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=preeti@linux.vnet.ibm.com \
--cc=rjw@sisk.pl \
--cc=tony.luck@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).