Messages in this thread | | | Subject | Re: [PATCH v2 05/10] hwmon: (fam15h_power) Add compute unit accumulated power | From | Guenter Roeck <> | Date | Fri, 23 Oct 2015 06:37:22 -0700 |
| |
On 10/23/2015 06:27 AM, Borislav Petkov wrote: > On Tue, Oct 20, 2015 at 10:28:24AM +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_call_function_many(). This behavior can decrease >> IPI numbers. >> >> Suggested-by: Borislav Petkov <bp@alien8.de> >> Signed-off-by: Huang Rui <ray.huang@amd.com> >> Cc: Guenter Roeck <linux@roeck-us.net> >> Cc: Peter Zijlstra <peterz@infradead.org> >> Cc: Ingo Molnar <mingo@kernel.org> >> --- >> drivers/hwmon/fam15h_power.c | 68 +++++++++++++++++++++++++++++++++++++++++++- >> 1 file changed, 67 insertions(+), 1 deletion(-) >>
[ ... ]
>> +static void do_read_registers_on_cu(void *_data) >> +{ >> + struct fam15h_power_data *data = _data; >> + int cpu, cu, cores_per_cu; >> + >> + cpu = smp_processor_id(); >> + >> + cores_per_cu = amd_get_cores_per_cu(); >> + cu = cpu / cores_per_cu; >> + >> + WARN_ON(rdmsrl_safe(MSR_F15H_CU_PWR_ACCUMULATOR, >> + &data->cu_acc_power[cu])); > > I guess the WARN_ON's here should be WARN_ON_ONCE() - otherwise dmesg is > filling up very quickly. > I don't really understand why WARN_ON (or WARN_ON_ONCE) would be warranted here in the first place.
Guenter
| |