Skip to contentSkip to conversation

BUG: unable to handle kernel paging request at 000000000000d968

x86/rapl Fengguang Wu 2 participants 2 messages Sep 25, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Christoph,

FYI, we noticed the below changes on

git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master commit 89cbc76768c2fa4ed95545bf961f3a14ddfeed21 ("x86: Replace __get_cpu_var uses")

+-----------------------------+------------+------------+
|                             | 532d0d0690 | 89cbc76768 |
+-----------------------------+------------+------------+
| boot_successes              | 5          | 4          |
| boot_failures               | 0          | 6          |
| BUG:unable_to_handle_kernel | 0          | 6          |
+-----------------------------+------------+------------+
[   36.889742] BUG: unable to handle kernel paging request at 000000000000d968
[   36.897739] IP: [<ffffffff81038282>] rapl_event_update+0x82/0xb0

Thanks,
Fengguang

_______________________________________________
LKP mailing list
LKP(a)linux.intel.com

#1 lore raw
Quoted 2 lines · Fengguang Wu
[   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.

arch/x86/kernel/cpu/perf_event_intel_rapl.c +1 -1
Index: linux/arch/x86/kernel/cpu/perf_event_intel_rapl.c
===================================================================
@@ -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)

_______________________________________________
LKP mailing list
LKP(a)linux.intel.com