Messages in this thread | | | From | Vince Weaver <> | Date | Thu, 22 Jan 2015 13:20:15 -0500 (EST) | Subject | Re: 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>
| |