lkml.org 
[lkml]   [2015]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: perf: easily crash kernel with rapl event close
On Thu, 22 Jan 2015, Stephane Eranian wrote:

> Fix looks like this:
>
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c
> b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
> index 6e434f8..c4bb8b8 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
> @@ -142,7 +142,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);
> }
>
>
> Will post the patch shortly.
> Thanks Vince for reporting this issue.

Well that's obviously a classic misplaced-parenthesis bug, but I patched
and re-ran my tests anyway to make sure this really fixed things.
(It did). So in case it is useful:

Tested-by: Vince Weaver <vincent.weaver@maine.edu>




\
 
 \ /
  Last update: 2015-01-22 19:41    [W:0.546 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site