[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Mar 2016 18:57:53 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Huang Rui <ray.huang@....com>
cc: Borislav Petkov <bp@...e.de>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...capital.net>,
Robert Richter <rric@...nel.org>,
Jacob Shin <jacob.w.shin@...il.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Kan Liang <kan.liang@...el.com>, linux-kernel@...r.kernel.org,
spg_linux_kernel@....com, x86@...nel.org,
Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>,
Borislav Petkov <bp@...en8.de>,
Fengguang Wu <fengguang.wu@...el.com>,
Guenter Roeck <linux@...ck-us.net>
Subject: Re: [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
Powered by blists - more mailing lists