• P
    perf/x86/intel: Clean up LBR state tracking · 3e2c1a67
    Peter Zijlstra 提交于
    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: NPeter 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: NIngo Molnar <mingo@kernel.org>
    3e2c1a67
lbr.c 29.4 KB