lkml.org 
[lkml]   [2016]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 2/2] perf/x86/amd/power: Add AMD accumulated power reporting mechanism
On Fri, 4 Mar 2016, Huang Rui wrote:
> On Thu, Mar 03, 2016 at 04:26:46PM +0100, Thomas Gleixner wrote:
> > Why? You do a full for_each_online_cpu(i) loop after that, which does
> > exactly the same thing, right?
> >
>
> But looks like power_cpu_init cannot handle it if we don't take any
> action here.
>
> e. g.
> cpu_mask: 0000 and online mask: 1111 -> power_cpu_init(0) -> cpu_mask is still: 0000
>
> topology_sibling_cpumask(0): 0011
> target: 1 (i. e. we cannot do cpumask_set_cpu(0, &cpu_mask))

Fair enough, but then you don't need the power_cpu_init() call at all.

But your loop does not cover anything beyond the first socket. So you need a
separate init function which does:

for_each_online_cpu(cpu) {
target = cpumask_first(topology_sibling_cpumask(cpu));
if (!cpumask_test_cpu(target, cpumask))
cpumask_set_cpu(target, cpumask);
}

Thanks,

tglx



\
 
 \ /
  Last update: 2016-03-03 19:21    [W:0.434 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site