lkml.org 
[lkml]   [2016]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power
On Mon, Mar 28, 2016 at 11:29:52AM +0200, Borislav Petkov wrote:
> I think you want something like this: iterate over each core and put one
> of them into the mask.
>
> core = -1;
>
> for_each_online_cpu(cpu) {
> this_core = topology_core_id(cpu);
>
> if (this_core == core)
> continue;
>
> core = this_core;
>
> /* get any CPU on this compute unit */
> cpumask_set_cpu(cpumask_any(topology_sibling_cpumask(cpu)), mask);
> }

This will not in fact work for Intel, nor if I manage to one day
randomize our CPU numbers on AMD.

\
 
 \ /
  Last update: 2016-03-29 09:41    [W:0.386 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site