]> git.baikalelectronics.ru Git - kernel.git/commit
perf/x86: Move cpuc->running into P4 specific code
authorKan Liang <kan.liang@linux.intel.com>
Wed, 14 Apr 2021 14:36:29 +0000 (07:36 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 16 Apr 2021 14:32:42 +0000 (16:32 +0200)
commit3f29d0f1089cd919230b764c9a1a61802a7aa1ba
treef9daafc5262424ad7e8d20404c07999d59bd2863
parenta707aab76c35fbc1af7765a32b3d64b3c2925db2
perf/x86: Move cpuc->running into P4 specific code

The 'running' variable is only used in the P4 PMU. Current perf sets the
variable in the critical function x86_pmu_start(), which wastes cycles
for everybody not running on P4.

Move cpuc->running into the P4 specific p4_pmu_enable_event().

Add a static per-CPU 'p4_running' variable to replace the 'running'
variable in the struct cpu_hw_events. Saves space for the generic
structure.

The p4_pmu_enable_all() also invokes the p4_pmu_enable_event(), but it
should not set cpuc->running. Factor out __p4_pmu_enable_event() for
p4_pmu_enable_all().

Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1618410990-21383-1-git-send-email-kan.liang@linux.intel.com
arch/x86/events/core.c
arch/x86/events/intel/p4.c
arch/x86/events/perf_event.h