Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-29 Thread Borislav Petkov
On Tue, Mar 29, 2016 at 09:31:58AM +0200, Peter Zijlstra wrote: > This will not in fact work for Intel, nor if I manage to one day > randomize our CPU numbers on AMD. Oh, I know why. I have this 64 CPUs box here: $ grep "core id" /proc/cpuinfo | uniq core id : 0 core id : 8 core i

Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-29 Thread Peter Zijlstra
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 (

Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-28 Thread Huang Rui
On Mon, Mar 28, 2016 at 11:29:52AM +0200, Borislav Petkov wrote: > On Mon, Mar 28, 2016 at 01:32:12PM +0800, Huang Rui wrote: > > + > > + get_online_cpus(); > > + this_cpu = get_cpu(); > > What now? > > get_online_cpus() is enough. > Will remove get_cpu(). > > + > > + /* > > +* Choos

Re: [PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-28 Thread Borislav Petkov
On Mon, Mar 28, 2016 at 01:32:12PM +0800, Huang Rui wrote: > This patch adds a member in fam15h_power_data which specifies the > compute unit accumulated power. It adds do_read_registers_on_cu to do > all the read to all MSRs and run it on one of the online cores on each > compute unit with smp_cal

[PATCH v5 2/6] hwmon: (fam15h_power) Add compute unit accumulated power

2016-03-27 Thread Huang Rui
This patch adds a member in fam15h_power_data which specifies the compute unit accumulated power. It adds do_read_registers_on_cu to do all the read to all MSRs and run it on one of the online cores on each compute unit with smp_call_function_many(). This behavior can decrease IPI numbers. Suggest