linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: morten.rasmussen@arm.com
Cc: peterz@infradead.org, mingo@redhat.com,
	vincent.guittot@linaro.org, daniel.lezcano@linaro.org,
	Dietmar Eggemann <Dietmar.Eggemann@arm.com>,
	yuyang.du@intel.com, mturquette@baylibre.com, rjw@rjwysocki.net,
	Juri Lelli <Juri.Lelli@arm.com>,
	sgurrappadi@nvidia.com, pang.xunlei@zte.com.cn,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Russell King <linux@arm.linux.org.uk>
Subject: Re: [RFCv5, 18/46] arm: topology: Define TC2 energy and provide it to the scheduler
Date: Mon, 17 Aug 2015 17:19:42 +0800	[thread overview]
Message-ID: <20150817091942.GA754@leoy-linaro> (raw)
In-Reply-To: <1436293469-25707-19-git-send-email-morten.rasmussen@arm.com>

Hi Morten,

On Tue, Jul 07, 2015 at 07:24:01PM +0100, Morten Rasmussen wrote:
> From: Dietmar Eggemann <dietmar.eggemann@arm.com>
> 
> This patch is only here to be able to test provisioning of energy related
> data from an arch topology shim layer to the scheduler. Since there is no
> code today which deals with extracting energy related data from the dtb or
> acpi, and process it in the topology shim layer, the content of the
> sched_group_energy structures as well as the idle_state and capacity_state
> arrays are hard-coded here.
> 
> This patch defines the sched_group_energy structure as well as the
> idle_state and capacity_state array for the cluster (relates to sched
> groups (sgs) in DIE sched domain level) and for the core (relates to sgs
> in MC sd level) for a Cortex A7 as well as for a Cortex A15.
> It further provides related implementations of the sched_domain_energy_f
> functions (cpu_cluster_energy() and cpu_core_energy()).
> 
> To be able to propagate this information from the topology shim layer to
> the scheduler, the elements of the arm_topology[] table have been
> provisioned with the appropriate sched_domain_energy_f functions.
> 
> cc: Russell King <linux@arm.linux.org.uk>
> 
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> 
> ---
> arch/arm/kernel/topology.c | 118 +++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 115 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index b35d3e5..bbe20c7 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -274,6 +274,119 @@ void store_cpu_topology(unsigned int cpuid)
>  		cpu_topology[cpuid].socket_id, mpidr);
>  }
>  
> +/*
> + * ARM TC2 specific energy cost model data. There are no unit requirements for
> + * the data. Data can be normalized to any reference point, but the
> + * normalization must be consistent. That is, one bogo-joule/watt must be the
> + * same quantity for all data, but we don't care what it is.
> + */
> +static struct idle_state idle_states_cluster_a7[] = {
> +	 { .power = 25 }, /* WFI */

This state is confused. Is this state corresponding to all CPUs have been
powered off but L2 cache RAM array and SCU are still power on?

> +	 { .power = 10 }, /* cluster-sleep-l */

Is this status means all CPU and cluster have been powered off, if so
then it will have no power consumption anymore...

> +	};
> +
> +static struct idle_state idle_states_cluster_a15[] = {
> +	 { .power = 70 }, /* WFI */
> +	 { .power = 25 }, /* cluster-sleep-b */
> +	};
> +
> +static struct capacity_state cap_states_cluster_a7[] = {
> +	/* Cluster only power */
> +	 { .cap =  150, .power = 2967, }, /*  350 MHz */

For cluster level's capacity, does it mean need run benchmark on all
CPUs within cluster?

> +	 { .cap =  172, .power = 2792, }, /*  400 MHz */
> +	 { .cap =  215, .power = 2810, }, /*  500 MHz */
> +	 { .cap =  258, .power = 2815, }, /*  600 MHz */
> +	 { .cap =  301, .power = 2919, }, /*  700 MHz */
> +	 { .cap =  344, .power = 2847, }, /*  800 MHz */
> +	 { .cap =  387, .power = 3917, }, /*  900 MHz */
> +	 { .cap =  430, .power = 4905, }, /* 1000 MHz */
> +	};
> +
> +static struct capacity_state cap_states_cluster_a15[] = {
> +	/* Cluster only power */
> +	 { .cap =  426, .power =  7920, }, /*  500 MHz */
> +	 { .cap =  512, .power =  8165, }, /*  600 MHz */
> +	 { .cap =  597, .power =  8172, }, /*  700 MHz */
> +	 { .cap =  682, .power =  8195, }, /*  800 MHz */
> +	 { .cap =  768, .power =  8265, }, /*  900 MHz */
> +	 { .cap =  853, .power =  8446, }, /* 1000 MHz */
> +	 { .cap =  938, .power = 11426, }, /* 1100 MHz */
> +	 { .cap = 1024, .power = 15200, }, /* 1200 MHz */
> +	};
> +
> +static struct sched_group_energy energy_cluster_a7 = {
> +	  .nr_idle_states = ARRAY_SIZE(idle_states_cluster_a7),
> +	  .idle_states    = idle_states_cluster_a7,
> +	  .nr_cap_states  = ARRAY_SIZE(cap_states_cluster_a7),
> +	  .cap_states     = cap_states_cluster_a7,
> +};
> +
> +static struct sched_group_energy energy_cluster_a15 = {
> +	  .nr_idle_states = ARRAY_SIZE(idle_states_cluster_a15),
> +	  .idle_states    = idle_states_cluster_a15,
> +	  .nr_cap_states  = ARRAY_SIZE(cap_states_cluster_a15),
> +	  .cap_states     = cap_states_cluster_a15,
> +};
> +
> +static struct idle_state idle_states_core_a7[] = {
> +	 { .power = 0 }, /* WFI */

Should have two idle states for CPU level (WFI and CPU's power off)?

> +	};
> +
> +static struct idle_state idle_states_core_a15[] = {
> +	 { .power = 0 }, /* WFI */
> +	};
> +
> +static struct capacity_state cap_states_core_a7[] = {
> +	/* Power per cpu */
> +	 { .cap =  150, .power =  187, }, /*  350 MHz */
> +	 { .cap =  172, .power =  275, }, /*  400 MHz */
> +	 { .cap =  215, .power =  334, }, /*  500 MHz */
> +	 { .cap =  258, .power =  407, }, /*  600 MHz */
> +	 { .cap =  301, .power =  447, }, /*  700 MHz */
> +	 { .cap =  344, .power =  549, }, /*  800 MHz */
> +	 { .cap =  387, .power =  761, }, /*  900 MHz */
> +	 { .cap =  430, .power = 1024, }, /* 1000 MHz */
> +	};
> +
> +static struct capacity_state cap_states_core_a15[] = {
> +	/* Power per cpu */
> +	 { .cap =  426, .power = 2021, }, /*  500 MHz */
> +	 { .cap =  512, .power = 2312, }, /*  600 MHz */
> +	 { .cap =  597, .power = 2756, }, /*  700 MHz */
> +	 { .cap =  682, .power = 3125, }, /*  800 MHz */
> +	 { .cap =  768, .power = 3524, }, /*  900 MHz */
> +	 { .cap =  853, .power = 3846, }, /* 1000 MHz */
> +	 { .cap =  938, .power = 5177, }, /* 1100 MHz */
> +	 { .cap = 1024, .power = 6997, }, /* 1200 MHz */
> +	};
> +
> +static struct sched_group_energy energy_core_a7 = {
> +	  .nr_idle_states = ARRAY_SIZE(idle_states_core_a7),
> +	  .idle_states    = idle_states_core_a7,
> +	  .nr_cap_states  = ARRAY_SIZE(cap_states_core_a7),
> +	  .cap_states     = cap_states_core_a7,
> +};
> +
> +static struct sched_group_energy energy_core_a15 = {
> +	  .nr_idle_states = ARRAY_SIZE(idle_states_core_a15),
> +	  .idle_states    = idle_states_core_a15,
> +	  .nr_cap_states  = ARRAY_SIZE(cap_states_core_a15),
> +	  .cap_states     = cap_states_core_a15,
> +};
> +
> +/* sd energy functions */
> +static inline const struct sched_group_energy *cpu_cluster_energy(int cpu)
> +{
> +	return cpu_topology[cpu].socket_id ? &energy_cluster_a7 :
> +			&energy_cluster_a15;
> +}
> +
> +static inline const struct sched_group_energy *cpu_core_energy(int cpu)
> +{
> +	return cpu_topology[cpu].socket_id ? &energy_core_a7 :
> +			&energy_core_a15;
> +}
> +
>  static inline int cpu_corepower_flags(void)
>  {
>  	return SD_SHARE_PKG_RESOURCES  | SD_SHARE_POWERDOMAIN | \
> @@ -282,10 +395,9 @@ static inline int cpu_corepower_flags(void)
>  
>  static struct sched_domain_topology_level arm_topology[] = {
>  #ifdef CONFIG_SCHED_MC
> -	{ cpu_corepower_mask, cpu_corepower_flags, SD_INIT_NAME(GMC) },
> -	{ cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
> +	{ cpu_coregroup_mask, cpu_corepower_flags, cpu_core_energy, SD_INIT_NAME(MC) },
>  #endif
> -	{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
> +	{ cpu_cpu_mask, 0, cpu_cluster_energy, SD_INIT_NAME(DIE) },
>  	{ NULL, },
>  };
>  

  parent reply	other threads:[~2015-08-17  9:19 UTC|newest]

Thread overview: 155+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 18:23 [RFCv5 PATCH 00/46] sched: Energy cost model for energy-aware scheduling Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 01/46] arm: Frequency invariant scheduler load-tracking support Morten Rasmussen
2015-07-21 15:41   ` [RFCv5, " Leo Yan
2015-07-22 13:31     ` Morten Rasmussen
2015-07-22 14:59       ` Leo Yan
2015-07-23 11:06         ` Morten Rasmussen
2015-07-23 14:22           ` Leo Yan
2015-07-24  9:43             ` Morten Rasmussen
2015-08-03  9:22   ` [RFCv5 PATCH " Vincent Guittot
2015-08-17 15:59     ` Dietmar Eggemann
2015-08-11  9:27   ` Peter Zijlstra
2015-08-14 16:08     ` Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 02/46] sched: Make load tracking frequency scale-invariant Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 03/46] arm: vexpress: Add CPU clock-frequencies to TC2 device-tree Morten Rasmussen
2015-07-08 12:36   ` Jon Medhurst (Tixy)
2015-07-10 13:35     ` Dietmar Eggemann
2015-07-07 18:23 ` [RFCv5 PATCH 04/46] sched: Convert arch_scale_cpu_capacity() from weak function to #define Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 05/46] arm: Update arch_scale_cpu_capacity() to reflect change to define Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 06/46] sched: Make usage tracking cpu scale-invariant Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 07/46] arm: Cpu invariant scheduler load-tracking support Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 08/46] sched: Get rid of scaling usage by cpu_capacity_orig Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 09/46] sched: Track blocked utilization contributions Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 10/46] sched: Include blocked utilization in usage tracking Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 11/46] sched: Remove blocked load and utilization contributions of dying tasks Morten Rasmussen
2015-07-22  6:51   ` Leo Yan
2015-07-22 13:45     ` Morten Rasmussen
2015-08-11 11:39   ` Peter Zijlstra
2015-08-11 14:58     ` Morten Rasmussen
2015-08-11 17:23       ` Peter Zijlstra
2015-08-12  9:08         ` Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 12/46] sched: Initialize CFS task load and usage before placing task on rq Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 13/46] sched: Documentation for scheduler energy cost model Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 14/46] sched: Make energy awareness a sched feature Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 15/46] sched: Introduce energy data structures Morten Rasmussen
2015-07-07 18:23 ` [RFCv5 PATCH 16/46] sched: Allocate and initialize " Morten Rasmussen
2015-08-12 10:04   ` Peter Zijlstra
2015-08-12 17:08     ` Dietmar Eggemann
2015-08-12 10:17   ` Peter Zijlstra
2015-08-12 17:09     ` Dietmar Eggemann
2015-08-12 17:23       ` Peter Zijlstra
2015-07-07 18:24 ` [RFCv5 PATCH 17/46] sched: Introduce SD_SHARE_CAP_STATES sched_domain flag Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 18/46] arm: topology: Define TC2 energy and provide it to the scheduler Morten Rasmussen
2015-08-12 10:33   ` Peter Zijlstra
2015-08-12 18:47     ` Dietmar Eggemann
2015-08-17  9:19   ` Leo Yan [this message]
2015-08-20 19:19     ` [RFCv5, " Dietmar Eggemann
2015-07-07 18:24 ` [RFCv5 PATCH 19/46] sched: Compute cpu capacity available at current frequency Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 20/46] sched: Relocated get_cpu_usage() and change return type Morten Rasmussen
2015-08-12 10:59   ` Peter Zijlstra
2015-08-12 14:40     ` Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 21/46] sched: Highest energy aware balancing sched_domain level pointer Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 22/46] sched: Calculate energy consumption of sched_group Morten Rasmussen
2015-08-13 15:34   ` Peter Zijlstra
2015-08-14 10:28     ` Morten Rasmussen
2015-09-02 17:19   ` Leo Yan
2015-09-17 16:41     ` Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 23/46] sched: Extend sched_group_energy to test load-balancing decisions Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 24/46] sched: Estimate energy impact of scheduling decisions Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 25/46] sched: Add over-utilization/tipping point indicator Morten Rasmussen
2015-08-13 17:35   ` Peter Zijlstra
2015-08-14 13:02     ` Morten Rasmussen
2015-09-29 20:08       ` Steve Muckle
2015-10-09 12:49         ` Morten Rasmussen
2015-08-17 13:10   ` Leo Yan
2015-07-07 18:24 ` [RFCv5 PATCH 26/46] sched: Store system-wide maximum cpu capacity in root domain Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 27/46] sched, cpuidle: Track cpuidle state index in the scheduler Morten Rasmussen
2015-07-21  6:41   ` Leo Yan
2015-07-21 15:16     ` Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 28/46] sched: Count number of shallower idle-states in struct sched_group_energy Morten Rasmussen
2015-08-13 18:10   ` Peter Zijlstra
2015-08-14 19:08     ` Sai Gurrappadi
2015-07-07 18:24 ` [RFCv5 PATCH 29/46] sched: Determine the current sched_group idle-state Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 30/46] sched: Add cpu capacity awareness to wakeup balancing Morten Rasmussen
2015-08-13 18:24   ` Peter Zijlstra
2015-08-14 16:20     ` Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 31/46] sched: Consider spare cpu capacity at task wake-up Morten Rasmussen
2015-07-21  0:37   ` Sai Gurrappadi
2015-07-21 15:12     ` Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 32/46] sched: Energy-aware wake-up task placement Morten Rasmussen
2015-07-17  0:10   ` Sai Gurrappadi
2015-07-20 15:38     ` Morten Rasmussen
2015-08-17 16:23   ` Leo Yan
2015-09-02 17:11   ` Leo Yan
2015-09-18 10:34     ` Dietmar Eggemann
2015-09-20 18:39       ` Steve Muckle
2015-09-20 22:03         ` Leo Yan
2015-09-29  0:15           ` Steve Muckle
2015-07-07 18:24 ` [RFCv5 PATCH 33/46] sched: Consider a not over-utilized energy-aware system as balanced Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 34/46] sched: Enable idle balance to pull single task towards cpu with higher capacity Morten Rasmussen
2015-08-15  9:15   ` Peter Zijlstra
2015-07-07 18:24 ` [RFCv5 PATCH 35/46] sched: Disable energy-unfriendly nohz kicks Morten Rasmussen
2015-08-15  9:33   ` Peter Zijlstra
2015-07-07 18:24 ` [RFCv5 PATCH 36/46] sched: Prevent unnecessary active balance of single task in sched group Morten Rasmussen
2015-08-15  9:46   ` Peter Zijlstra
2015-07-07 18:24 ` [RFCv5 PATCH 37/46] cpufreq: introduce cpufreq_driver_might_sleep Morten Rasmussen
2015-07-08 15:09   ` Michael Turquette
2015-07-07 18:24 ` [RFCv5 PATCH 38/46] sched: scheduler-driven cpu frequency selection Morten Rasmussen
2015-07-08 15:09   ` Michael Turquette
2015-08-11  2:14   ` Leo Yan
2015-08-11  8:59     ` Juri Lelli
2015-08-15 12:35   ` Peter Zijlstra
2015-09-04 13:27     ` Juri Lelli
2015-09-14 15:57       ` Juri Lelli
2015-09-15 13:45         ` Peter Zijlstra
2015-09-15 16:22           ` Juri Lelli
2015-08-15 13:05   ` Peter Zijlstra
2015-08-25 10:45     ` Juri Lelli
2015-10-08  0:14       ` Steve Muckle
2015-10-08  9:41         ` Juri Lelli
2015-09-28 16:48   ` Punit Agrawal
2015-09-29  0:26     ` Steve Muckle
2015-07-07 18:24 ` [RFCv5 PATCH 39/46] sched/cpufreq_sched: use static key for " Morten Rasmussen
2015-07-08 15:19   ` Michael Turquette
2015-07-10  9:50     ` Juri Lelli
2015-08-15 12:40     ` Peter Zijlstra
2015-07-07 18:24 ` [RFCv5 PATCH 40/46] sched/cpufreq_sched: compute freq_new based on capacity_orig_of() Morten Rasmussen
2015-07-08 15:22   ` Michael Turquette
2015-07-09 16:21     ` Juri Lelli
2015-08-15 12:46   ` Peter Zijlstra
2015-08-16  4:03     ` Michael Turquette
2015-08-16 20:24       ` Peter Zijlstra
2015-08-17 12:19         ` Juri Lelli
2015-10-13 19:47           ` Steve Muckle
2015-07-07 18:24 ` [RFCv5 PATCH 41/46] sched/fair: add triggers for OPP change requests Morten Rasmussen
2015-07-08 15:42   ` Michael Turquette
2015-07-09 16:52     ` Juri Lelli
2015-08-04 13:41   ` Vincent Guittot
2015-08-10 13:43     ` Juri Lelli
2015-08-10 15:07       ` Vincent Guittot
2015-08-11  9:08         ` Juri Lelli
2015-08-11 11:41           ` Vincent Guittot
2015-08-11 15:07             ` Juri Lelli
2015-08-11 16:37               ` Vincent Guittot
2015-08-12 15:15                 ` Juri Lelli
2015-08-13 12:08                   ` Vincent Guittot
2015-08-14 11:39                     ` Juri Lelli
2015-08-17  9:43                       ` Vincent Guittot
2015-08-15 12:48   ` Peter Zijlstra
2015-08-16  3:50     ` Michael Turquette
2015-08-17 18:22     ` Rafael J. Wysocki
2015-07-07 18:24 ` [RFCv5 PATCH 42/46] sched/{core,fair}: trigger OPP change request on fork() Morten Rasmussen
2015-07-07 18:24 ` [RFCv5 PATCH 43/46] sched/{fair,cpufreq_sched}: add reset_capacity interface Morten Rasmussen
2015-10-08 20:40   ` Steve Muckle
2015-10-09  9:14     ` Juri Lelli
2015-10-12 19:02       ` Steve Muckle
2015-07-07 18:24 ` [RFCv5 PATCH 44/46] sched/fair: jump to max OPP when crossing UP threshold Morten Rasmussen
2015-07-08 16:40   ` Michael Turquette
2015-07-08 16:47   ` Michael Turquette
2015-07-10 10:17     ` Juri Lelli
2015-07-07 18:24 ` [RFCv5 PATCH 45/46] sched/cpufreq_sched: modify pcpu_capacity handling Morten Rasmussen
2015-07-08 16:42   ` Michael Turquette
2015-07-09 16:55     ` Juri Lelli
2015-08-16 20:35   ` Peter Zijlstra
2015-08-17 11:16     ` Juri Lelli
2015-07-07 18:24 ` [RFCv5 PATCH 46/46] sched/fair: cpufreq_sched triggers for load balancing 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=20150817091942.GA754@leoy-linaro \
    --to=leo.yan@linaro.org \
    --cc=Dietmar.Eggemann@arm.com \
    --cc=Juri.Lelli@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=pang.xunlei@zte.com.cn \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=sgurrappadi@nvidia.com \
    --cc=vincent.guittot@linaro.org \
    --cc=yuyang.du@intel.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;
as well as URLs for NNTP newsgroup(s).