public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V8 0/8] large PEBS interrupt threshold
@ 2015-05-06 19:33 Kan Liang
  2015-05-06 19:33 ` [PATCH V8 1/8] perf, x86: use the PEBS auto reload mechanism when possible Kan Liang
                   ` (7 more replies)
  0 siblings, 8 replies; 29+ messages in thread
From: Kan Liang @ 2015-05-06 19:33 UTC (permalink / raw)
  To: peterz; +Cc: mingo, acme, eranian, andi, linux-kernel, Kan Liang

This patch series implements large PEBS interrupt threshold.
Currently, the PEBS threshold is forced to set to one. A larger PEBS
interrupt threshold can significantly reduce the sampling overhead
especially for frequently occurring events
(like cycles or branches or load/stores) with small sampling period.
For example, perf record cycles event when running kernbench
with 10003 sampling period. The Elapsed Time reduced from 32.7 seconds
to 16.5 seconds, which is 2X faster.
For more details, please refer to patch 4's description.

Limitations:
 - It can not supply a callgraph.
 - It requires setting a fixed period.
 - It cannot supply a time stamp.
 - To supply a TID it requires flushing on context switch.
If the above requirement doesn't apply, the threshold will set to one.

Discard samples:
When PEBS events happen close to each other, the records for the events
could be mixed up. Demuxing the records is hard because of hardware
deficiecy. As a result, we have to drop some PEBS records.
A new RECORD type, PERF_RECORD_LOST_SAMPLES, is introduced to record
the number of possible discards, and make sure the user is not left
in the dark about such discards.
For details about sample discards, please refer to patch 3's description.

changes since v1:
  - drop patch 'perf, core: Add all PMUs to pmu_idr'
  - add comments for case that multiple counters overflow simultaneously
changes since v2:
  - rename perf_sched_cb_{enable,disable} to perf_sched_cb_user_{inc,dec}
  - use flag to indicate auto reload mechanism
  - move codes that setup PEBS sample data to separate function
  - output the PEBS records in batch
  - enable this for All (PEBS capable) hardware
  - more description for the multiplex
changes since v3:
  - ignore conflicting PEBS record
changes since v4:
  - Do more tests for collision and update comments
changes since v5:
  - Move autoreload and large PEBS available check to intel_pmu_hw_config
  - make AUTO_RELOAD conditional on large PEBS
  - !PEBS bug fix
  - coherent story about what is collision and how we handle it
  - Remove extra state pebs_sched_cb_enabled
changes since v6:
  - new flag PERF_X86_EVENT_FREERUNNING to indicate large PEBS available
  - patch reorder and changelog changes for patch 1 and 3
  - An easy way to clear !PEBS bit
  - Log collision to PERF_RECORD_SAMPLES_LOST
changes since v7:
  - Introduce PERF_RECORD_LOST_SAMPLES to record the number of discards
  - Remove entire for_each_set_bit() loop
  - Minor changes on comments and changelog

Yan, Zheng (6):
  perf, x86: use the PEBS auto reload mechanism when possible
  perf, x86: introduce setup_pebs_sample_data()
  perf, x86: handle multiple records in PEBS buffer
  perf, x86: large PEBS interrupt threshold
  perf, x86: drain PEBS buffer during context switch
  perf, x86: enlarge PEBS buffer

Kan Liang (2):
  perf, x86: introduce PERF_RECORD_LOST_SAMPLES
  perf tools: handle PERF_RECORD_LOST_SAMPLES

 arch/x86/kernel/cpu/perf_event.c           |  15 +-
 arch/x86/kernel/cpu/perf_event.h           |  16 ++
 arch/x86/kernel/cpu/perf_event_intel.c     |  22 ++-
 arch/x86/kernel/cpu/perf_event_intel_ds.c  | 307 +++++++++++++++++++++--------
 arch/x86/kernel/cpu/perf_event_intel_lbr.c |   3 -
 include/linux/perf_event.h                 |  16 ++
 include/uapi/linux/perf_event.h            |  12 ++
 kernel/events/core.c                       |  41 +++-
 kernel/events/internal.h                   |   9 -
 tools/perf/util/event.c                    |   9 +
 tools/perf/util/event.h                    |  18 ++
 tools/perf/util/machine.c                  |  10 +
 tools/perf/util/machine.h                  |   2 +
 tools/perf/util/session.c                  |  19 ++
 tools/perf/util/tool.h                     |   1 +
 15 files changed, 390 insertions(+), 110 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-06-07 17:56 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-06 19:33 [PATCH V8 0/8] large PEBS interrupt threshold Kan Liang
2015-05-06 19:33 ` [PATCH V8 1/8] perf, x86: use the PEBS auto reload mechanism when possible Kan Liang
2015-06-07 17:49   ` [tip:perf/core] perf/x86/intel: Use " tip-bot for Yan, Zheng
2015-05-06 19:33 ` [PATCH V8 2/8] perf, x86: introduce setup_pebs_sample_data() Kan Liang
2015-06-07 17:49   ` [tip:perf/core] perf/x86/intel: Introduce setup_pebs_sample_data( ) tip-bot for Yan, Zheng
2015-05-06 19:33 ` [PATCH V8 3/8] perf, x86: handle multiple records in PEBS buffer Kan Liang
2015-05-08 11:05   ` Andi Kleen
2015-05-08 11:29     ` Peter Zijlstra
2015-06-07 17:49   ` [tip:perf/core] perf/x86/intel: Handle multiple records in the " tip-bot for Yan, Zheng
2015-05-06 19:33 ` [PATCH V8 4/8] perf, x86: large PEBS interrupt threshold Kan Liang
2015-06-07 17:49   ` [tip:perf/core] perf/x86/intel: Implement batched PEBS interrupt handling (large PEBS interrupt threshold ) tip-bot for Yan, Zheng
2015-05-06 19:33 ` [PATCH V8 5/8] perf, x86: drain PEBS buffer during context switch Kan Liang
2015-06-07 17:50   ` [tip:perf/core] perf/x86/intel: Drain the PEBS buffer during context switches tip-bot for Yan, Zheng
2015-05-06 19:33 ` [PATCH V8 6/8] perf, x86: enlarge PEBS buffer Kan Liang
2015-06-07 17:50   ` [tip:perf/core] perf/intel/x86: Enlarge the " tip-bot for Yan, Zheng
2015-05-06 19:33 ` [PATCH V8 7/8] perf, x86: introduce PERF_RECORD_LOST_SAMPLES Kan Liang
2015-05-07 11:35   ` Peter Zijlstra
2015-05-07 11:54     ` Peter Zijlstra
2015-05-07 14:15       ` Arnaldo Carvalho de Melo
2015-05-07 14:21         ` Arnaldo Carvalho de Melo
2015-05-07 14:39         ` Peter Zijlstra
2015-05-07 16:22           ` Arnaldo Carvalho de Melo
2015-05-07 17:37             ` Peter Zijlstra
2015-05-07 20:01               ` Arnaldo Carvalho de Melo
2015-05-07 13:56     ` Liang, Kan
2015-05-07 13:58       ` Peter Zijlstra
2015-05-06 19:33 ` [PATCH V8 8/8] perf tools: handle PERF_RECORD_LOST_SAMPLES Kan Liang
2015-05-07 10:33   ` Andi Kleen
2015-05-07 14:17     ` Liang, Kan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox