Re: [x86/rapl] BUG: unable to handle kernel paging request at 000000000000d968

From: Christoph Lameter
Date: Thu Sep 25 2014 - 14:45:23 EST


On Thu, 25 Sep 2014, Fengguang Wu wrote:

> [ 36.889742] BUG: unable to handle kernel paging request at 000000000000d968
> [ 36.897739] IP: [<ffffffff81038282>] rapl_event_update+0x82/0xb0

Does this fix it?


Subject: Fix this_cpu_read() in rapl_scale

rapl_pmu is a percpu variable containing a pointer not a percpu struct
from which we would like to fetch the value of a field.

Thus the read must get the pointer and not the target field.

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

Index: linux/arch/x86/kernel/cpu/perf_event_intel_rapl.c
===================================================================
--- linux.orig/arch/x86/kernel/cpu/perf_event_intel_rapl.c 2014-09-25 08:53:33.262406130 -0500
+++ linux/arch/x86/kernel/cpu/perf_event_intel_rapl.c 2014-09-25 13:42:33.636661521 -0500
@@ -135,7 +135,7 @@ static inline u64 rapl_scale(u64 v)
* or use ldexp(count, -32).
* Watts = Joules/Time delta
*/
- return v << (32 - __this_cpu_read(rapl_pmu->hw_unit));
+ return v << (32 - __this_cpu_read(rapl_pmu)->hw_unit);
}

static u64 rapl_event_update(struct perf_event *event)

Attachment: .dmesg
Description: Binary data

_______________________________________________
LKP mailing list
LKP@xxxxxxxxxxxxxxx