x86/perf, static_call: Optimize x86_pmu methods
authorPeter Zijlstra <peterz@infradead.org>
Tue, 18 Aug 2020 13:57:53 +0000 (15:57 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 1 Sep 2020 07:58:06 +0000 (09:58 +0200)
commit7c9903c9bf716d89b34f96cc2ed64e28dabf570b
tree8cc311229f7fa62089aeed4ae312a17a434a7ba7
parentd25e37d89dd2f41d7acae0429039d2f0ae8b4a07
x86/perf, static_call: Optimize x86_pmu methods

Replace many of the indirect calls with static_call().

The average PMI time, as measured by perf_sample_event_took()*:

  PRE:    3283.03 [ns]
  POST:   3145.12 [ns]

Which is a ~138 [ns] win per PMI, or a ~4.2% decrease.

[*] on an IVB-EP, using: 'perf record -a -e cycles -- make O=defconfig-build/ -j80'

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20200818135805.338001015@infradead.org
arch/x86/events/core.c