lkml.org 
[lkml]   [2018]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/8] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver
From
Date
On 31/01/2018 10:01, Vincent Guittot wrote:
> Hi Daniel,
>
> On 23 January 2018 at 16:34, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:

[ ... ] (please trim :)

>> + /*
>> + * Each cooling device is per package. Each package
>> + * has a set of cpus where the physical number is
>> + * duplicate in the kernel namespace. We need a way to
>> + * address the waitq[] and tsk[] arrays with index
>> + * which are not Linux cpu numbered.
>> + *
>> + * One solution is to use the
>> + * topology_core_id(cpu). Other solution is to use the
>> + * modulo.
>> + *
>> + * eg. 2 x cluster - 4 cores.
>> + *
>> + * Physical numbering -> Linux numbering -> % nr_cpus
>> + *
>> + * Pkg0 - Cpu0 -> 0 -> 0
>> + * Pkg0 - Cpu1 -> 1 -> 1
>> + * Pkg0 - Cpu2 -> 2 -> 2
>> + * Pkg0 - Cpu3 -> 3 -> 3
>> + *
>> + * Pkg1 - Cpu0 -> 4 -> 0
>> + * Pkg1 - Cpu1 -> 5 -> 1
>> + * Pkg1 - Cpu2 -> 6 -> 2
>> + * Pkg1 - Cpu3 -> 7 -> 3
>
>
> I'm not sure that the assumption above for the CPU numbering is safe.
> Can't you use a per cpu structure to point to resources that are per
> cpu instead ? so you will not have to rely on CPU ordering

Can you elaborate ? I don't get the part with the percpu structure.


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

\
 
 \ /
  Last update: 2018-01-31 10:34    [W:0.147 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site