perf/x86/intel: Clean up LBR state tracking
authorPeter Zijlstra <peterz@infradead.org>
Thu, 7 Jul 2016 17:37:52 +0000 (19:37 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 10 Aug 2016 11:13:27 +0000 (13:13 +0200)
commit3e2c1a67d616dbc1034bc39448cd5f4aa3bd3cca
treed7724d36646c8d2614a49a59518254abdaf0fa71
parenta5dcff628a678b9f4535155662f81c5cda066bc7
perf/x86/intel: Clean up LBR state tracking

The lbr_context logic confused me; it appears to me to try and do the
same thing the pmu::sched_task() callback does now, but limited to
per-task events.

So rip it out. Afaict this should also improve performance, because I
think the current code can end up doing lbr_reset() twice, once from
the pmu::add() and then again from pmu::sched_task(), and MSR writes
(all 3*16 of them) are expensive!!

While thinking through the cases that need the reset it occured to me
the first install of an event in an active context needs to reset the
LBR (who knows what crap is in there), but detecting this case is
somewhat hard.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/intel/lbr.c
arch/x86/events/perf_event.h
This page took 0.024615 seconds and 5 git commands to generate.