Re: [PATCH V6 0/6] Intel memory b/w monitoring support

From: Peter Zijlstra
Date: Sat Mar 12 2016 - 02:53:33 EST


On Sat, Mar 12, 2016 at 01:56:13AM +0000, Luck, Tony wrote:
> Some tracing printk() show that we are calling update_sample() with totally bogus arguments.
>
> There are a few good calls, then I see rmid=-380863112 evt_type=-30689 first=0
>
> That turns into a wild vrmid, and we fault accessing mbm_current->prev_msr

It's because I'm a right idiot.. The below should sort that methinks.

Will push a new branch

--- a/arch/x86/events/intel/cqm.c
+++ b/arch/x86/events/intel/cqm.c
@@ -466,9 +466,9 @@ static bool is_mbm_event(int e)
static void cqm_mask_call(struct rmid_read *rr)
{
if (is_mbm_event(rr->evt_type))
- on_each_cpu_mask(&cqm_cpumask, __intel_mbm_event_count, &rr, 1);
+ on_each_cpu_mask(&cqm_cpumask, __intel_mbm_event_count, rr, 1);
else
- on_each_cpu_mask(&cqm_cpumask, __intel_cqm_event_count, &rr, 1);
+ on_each_cpu_mask(&cqm_cpumask, __intel_cqm_event_count, rr, 1);
}

/*