All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: Jean Pihet <jean.pihet@newoldbits.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org,
	devicetree-discuss@lists.ozlabs.org, linux@arm.linux.org.uk,
	peterz@infradead.org, grant.likely@secretlab.ca,
	rob.herring@calxeda.com
Subject: Re: [RFC 3/4] ARM: topology: Update cpu_power according to DT information
Date: Wed, 13 Jun 2012 11:44:45 +0200	[thread overview]
Message-ID: <CAKfTPtBc-KuDg_1qe04TfYS4+66qQoiHCJQbCF9gnhga5ociow@mail.gmail.com> (raw)
In-Reply-To: <CAORVsuWqWt0pJfewymh_ydAH61-uPsO0M7m7Gs4N3zJY=Vo9ZA@mail.gmail.com>

On 13 June 2012 10:59, Jean Pihet <jean.pihet@newoldbits.com> wrote:
> Vincent,
>
> On Tue, Jun 12, 2012 at 2:02 PM, Vincent Guittot
> <vincent.guittot@linaro.org> wrote:
>> Use cpu compatibility field and clock-frequency field of DT to
>> estimate the capacity of each core of the system
>>
>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>> ---
>>  arch/arm/kernel/topology.c |  122 ++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 122 insertions(+)
>>
>> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
>> index 2f85a64..0c2aee4 100644
>> --- a/arch/arm/kernel/topology.c
>> +++ b/arch/arm/kernel/topology.c
>> @@ -17,6 +17,7 @@
>>  #include <linux/percpu.h>
>>  #include <linux/node.h>
>>  #include <linux/nodemask.h>
>> +#include <linux/of.h>
>>  #include <linux/sched.h>
>>
>>  #include <asm/cputype.h>
>> @@ -47,6 +48,122 @@ void set_power_scale(unsigned int cpu, unsigned long power)
>>        per_cpu(cpu_scale, cpu) = power;
>>  }
>>
>> +#ifdef CONFIG_OF
>> +struct cpu_efficiency {
>> +       const char *compatible;
>> +       unsigned long efficiency;
>> +};
>> +
>> +/*
>> + * Table of relative efficiency of each processors
>> + * The efficiency value must fit in 20bit. The final
>> + * cpu_scale value must be in the range [1:2048[.
> Typo here.

I realize that I have use absolute value instead of SCHED_POWER_SCALE.
The cpu_scale value must be in the range 0 < cpu_scale < 2*SCHED_POWER_SCALE

>
>> + * Processors that are not defined in the table,
>> + * use the default SCHED_POWER_SCALE value for cpu_scale.
>> + */
>> +struct cpu_efficiency table_efficiency[] = {
>> +       {"arm,cortex-a15", 3891},
>> +       {"arm,cortex-a7",  2048},
> How are those results measured or computed? Is this purely related to
> the number crunching performance?

These values are based on ARM's figures which say that Cortex-A15 is
1,9 faster than Cortex-A7 at same frequency. So the inputs are ARM's
figures. Then, the absolute values are arbitrary with the constraint
of being large enough for precision and small enough to make the
computation in an unsigned long

>
> Also more generally what if the cores frequencies are changing?

Up to now, the scheduler takes into account the maximum capacity of a
core when it checks the load balance of the system.

Regards,
Vincent

>
> Regards,
> Jean

WARNING: multiple messages have this Message-ID (diff)
From: vincent.guittot@linaro.org (Vincent Guittot)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 3/4] ARM: topology: Update cpu_power according to DT information
Date: Wed, 13 Jun 2012 11:44:45 +0200	[thread overview]
Message-ID: <CAKfTPtBc-KuDg_1qe04TfYS4+66qQoiHCJQbCF9gnhga5ociow@mail.gmail.com> (raw)
In-Reply-To: <CAORVsuWqWt0pJfewymh_ydAH61-uPsO0M7m7Gs4N3zJY=Vo9ZA@mail.gmail.com>

On 13 June 2012 10:59, Jean Pihet <jean.pihet@newoldbits.com> wrote:
> Vincent,
>
> On Tue, Jun 12, 2012 at 2:02 PM, Vincent Guittot
> <vincent.guittot@linaro.org> wrote:
>> Use cpu compatibility field and clock-frequency field of DT to
>> estimate the capacity of each core of the system
>>
>> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
>> ---
>> ?arch/arm/kernel/topology.c | ?122 ++++++++++++++++++++++++++++++++++++++++++++
>> ?1 file changed, 122 insertions(+)
>>
>> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
>> index 2f85a64..0c2aee4 100644
>> --- a/arch/arm/kernel/topology.c
>> +++ b/arch/arm/kernel/topology.c
>> @@ -17,6 +17,7 @@
>> ?#include <linux/percpu.h>
>> ?#include <linux/node.h>
>> ?#include <linux/nodemask.h>
>> +#include <linux/of.h>
>> ?#include <linux/sched.h>
>>
>> ?#include <asm/cputype.h>
>> @@ -47,6 +48,122 @@ void set_power_scale(unsigned int cpu, unsigned long power)
>> ? ? ? ?per_cpu(cpu_scale, cpu) = power;
>> ?}
>>
>> +#ifdef CONFIG_OF
>> +struct cpu_efficiency {
>> + ? ? ? const char *compatible;
>> + ? ? ? unsigned long efficiency;
>> +};
>> +
>> +/*
>> + * Table of relative efficiency of each processors
>> + * The efficiency value must fit in 20bit. The final
>> + * cpu_scale value must be in the range [1:2048[.
> Typo here.

I realize that I have use absolute value instead of SCHED_POWER_SCALE.
The cpu_scale value must be in the range 0 < cpu_scale < 2*SCHED_POWER_SCALE

>
>> + * Processors that are not defined in the table,
>> + * use the default SCHED_POWER_SCALE value for cpu_scale.
>> + */
>> +struct cpu_efficiency table_efficiency[] = {
>> + ? ? ? {"arm,cortex-a15", 3891},
>> + ? ? ? {"arm,cortex-a7", ?2048},
> How are those results measured or computed? Is this purely related to
> the number crunching performance?

These values are based on ARM's figures which say that Cortex-A15 is
1,9 faster than Cortex-A7 at same frequency. So the inputs are ARM's
figures. Then, the absolute values are arbitrary with the constraint
of being large enough for precision and small enough to make the
computation in an unsigned long

>
> Also more generally what if the cores frequencies are changing?

Up to now, the scheduler takes into account the maximum capacity of a
core when it checks the load balance of the system.

Regards,
Vincent

>
> Regards,
> Jean

  reply	other threads:[~2012-06-13  9:44 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 12:02 [RFC 0/4] ARM: topology: set the capacity of each cores for big.LITTLE Vincent Guittot
2012-06-12 12:02 ` Vincent Guittot
2012-06-12 12:02 ` [RFC 1/4] ARM: topology: Add arch_scale_freq_power function Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-13  8:50   ` Jean Pihet
2012-06-13  8:50     ` Jean Pihet
2012-06-13  9:22     ` Vincent Guittot
2012-06-13  9:22       ` Vincent Guittot
2012-06-13 12:52   ` Peter Zijlstra
2012-06-13 12:52     ` Peter Zijlstra
2012-06-13 19:27     ` Andy Whitcroft
2012-06-13 19:27       ` Andy Whitcroft
2012-06-13 19:27       ` Andy Whitcroft
2012-06-13 19:30       ` Joe Perches
2012-06-13 19:30         ` Joe Perches
2012-06-13 21:51       ` Peter Zijlstra
2012-06-13 21:51         ` Peter Zijlstra
2012-06-12 12:02 ` [RFC 2/4] ARM: topology: factorize the update of sibling masks Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-13 12:54   ` Peter Zijlstra
2012-06-13 12:54     ` Peter Zijlstra
2012-06-12 12:02 ` [RFC 3/4] ARM: topology: Update cpu_power according to DT information Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-13  8:59   ` Jean Pihet
2012-06-13  8:59     ` Jean Pihet
2012-06-13  9:44     ` Vincent Guittot [this message]
2012-06-13  9:44       ` Vincent Guittot
2012-06-13 12:44       ` Amit Kucheria
2012-06-13 12:44         ` Amit Kucheria
2012-06-13 12:47         ` Peter Zijlstra
2012-06-13 12:47           ` Peter Zijlstra
2012-06-13 12:50           ` Jean Pihet
2012-06-13 12:50             ` Jean Pihet
2012-06-13 13:29           ` Vincent Guittot
2012-06-13 13:29             ` Vincent Guittot
2012-06-13 13:32             ` Peter Zijlstra
2012-06-13 13:32               ` Peter Zijlstra
2012-06-13 14:31               ` Vincent Guittot
2012-06-13 14:31                 ` Vincent Guittot
2012-06-13 13:07   ` Peter Zijlstra
2012-06-13 13:07     ` Peter Zijlstra
2012-06-13 14:54     ` Vincent Guittot
2012-06-13 14:54       ` Vincent Guittot
2012-06-13 16:06       ` Peter Zijlstra
2012-06-13 16:06         ` Peter Zijlstra
2012-06-13 13:09   ` Peter Zijlstra
2012-06-13 13:09     ` Peter Zijlstra
2012-06-13 14:42     ` Nicolas Pitre
2012-06-13 14:42       ` Nicolas Pitre
2012-06-13 13:19   ` Peter Zijlstra
2012-06-13 13:19     ` Peter Zijlstra
2012-06-13 13:19     ` Peter Zijlstra
2012-06-12 12:02 ` [RFC 4/4] sched: cpu_power: enable ARCH_POWER Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-12 12:02   ` Vincent Guittot
2012-06-13 12:50   ` Peter Zijlstra
2012-06-13 12:50     ` Peter Zijlstra
2012-06-13 13:20     ` Vincent Guittot
2012-06-13 13:20       ` Vincent Guittot
2012-06-13 13:20       ` Vincent Guittot
2012-06-13 13:28       ` Peter Zijlstra
2012-06-13 13:28         ` Peter Zijlstra
2012-06-13 13:50         ` Vincent Guittot
2012-06-13 13:50           ` Vincent Guittot
2012-06-20 10:43         ` [tip:sched/core] sched/x86: Remove broken power estimation tip-bot for Peter Zijlstra
2012-07-24 14:13         ` tip-bot for Peter Zijlstra

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=CAKfTPtBc-KuDg_1qe04TfYS4+66qQoiHCJQbCF9gnhga5ociow@mail.gmail.com \
    --to=vincent.guittot@linaro.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jean.pihet@newoldbits.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=peterz@infradead.org \
    --cc=rob.herring@calxeda.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.