1. 16 Oct, 2013 1 commit
    • Peter Zijlstra's avatar
      perf/x86: Optimize intel_pmu_pebs_fixup_ip() · 9536c8d2
      Peter Zijlstra authored
      There's been reports of high NMI handler overhead, highlighted by
      such kernel messages:
      
        [ 3697.380195] perf samples too long (10009 > 10000), lowering kernel.perf_event_max_sample_rate to 13000
        [ 3697.389509] INFO: NMI handler (perf_event_nmi_handler) took too long to run: 9.331 msecs
      
      Don Zickus analyzed the source of the overhead and reported:
      
       > While there are a few places that are causing latencies, for now I focused on
       > the longest one first.  It seems to be 'copy_user_from_nmi'
       >
       > intel_pmu_handle_irq ->
       >	intel_pmu_drain_pebs_nhm ->
       >		__intel_pmu_drain_pebs_nhm ->
       >			__intel_pmu_pebs_event ->
       >				intel_pmu_pebs_fixup_ip ->
       >					copy_from_user_nmi
       >
       > In intel_pmu_pebs_fixup_ip(), if the while-loop goes over 50, the sum of
       > all the copy_from_user_nmi latencies seems to go over 1,000,000 cycles
       > (there are some cases where only 10 iterations are needed to go that high
       > too, but in generall over 50 or so).  At this point copy_user_from_nmi
       > seems to account for over 90% of the nmi latency.
      
      The solution to that is to avoid having to call copy_from_user_nmi() for
      every instruction.
      
      Since we already limit the max basic block size, we can easily
      pre-allocate a piece of memory to copy the entire thing into in one
      go.
      
      Don reported this test result:
      
       > Your patch made a huge difference in improvement.  The
       > copy_from_user_nmi() no longer hits the million of cycles.  I still
       > have a batch of 100,000-300,000 cycles.  My longest NMI paths used
       > to be dominated by copy_from_user_nmi, now it is not (I have to dig
       > up the new hot path).
      Reported-and-tested-by: default avatarDon Zickus <dzickus@redhat.com>
      Cc: jmario@redhat.com
      Cc: acme@infradead.org
      Cc: dave.hansen@linux.intel.com
      Cc: eranian@google.com
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20131016105755.GX10651@twins.programming.kicks-ass.netSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9536c8d2
  2. 15 Oct, 2013 2 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 1ff9ecf7
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
        * kcore annotation improvements, including build-id cache support,
          multi map 'call' instruction navigation fixes, kcore address
          validation, objdump workarounds. From Adrian Hunter.
      
        * 'trace' beautifiers for lots of syscall arguments, from Arnaldo Carvalho de Melo.
      
        * More compact 'trace' output by suppressing zeroed args, from Arnaldo Carvalho de Melo.
      
        * Show thread COMM by default in 'trace', from Arnaldo Carvalho de Melo.
      
        * Show path associated with fd in live sessions, using a 'vfs_getname'
          'perf probe' created dynamic tracepoint or by looking at /proc/pid/fd, from Arnaldo Carvalho de Melo.
      
        * Memory and mmap leak fixes from Chenggang Qin.
      
        * Add option to show full timestamp in 'trace', from David Ahern.
      
        * Add 'record' command in 'trace', to record raw_syscalls:*, from David Ahern.
      
        * Add summary option to dump syscall statistics in 'trace', from David Ahern.
      
        * Fix comm resolution in 'trace' when reading events from file, from David Ahern.
      
        * Improved messages when doing profiling in all or a subset of CPUs
          using a workload as the session delimitator, as in:
      
           'perf stat --cpu 0,2 sleep 10s'
      
          from Arnaldo Carvalho de Melo.
      
        * Add units to nanosec-based counters in 'perf stat', from David Ahern.
      
        * Assorted build fixes for from David Ahern and Jiri Olsa.
      
        * 'perf lock' fixes and cleanups, from Davidlohr Bueso.
      
        * Memory leak fixes in 'perf test', from Felipe Pena.
      
        * Build system super speedups, from Ingo Molnar.
      
        * Fix mmap_read event overflow, from Jiri Olsa.
      
        * Code cleanups from Jiri Olsa.
      
        * Allow specifying B/K/M/G unit to the --mmap-pages arguments, from Jiri Olsa.
      
        * Separate the GTK support in a separate libperf-gtk.so DSO, that is
          only loaded when --gtk is specified, from Namhyung Kim.
      
        * Fixes for some memory leaks, from Namhyumg Kim.
      
        * Fix srcline sort key behavior, from Namhyung Kim.
      
        * Fix failing assertions in numa bench, from Petr Holasek.
      
        * perf bash completion fixes and improvements from Ramkumar Ramachandra.
      
        * Improve error messages in 'trace', providing hints about system configuration
          steps needed for using it, from Ramkumar Ramachandra.
      
        * Remove bogus info when using 'perf stat' -e cycles/instructions, from
          Ramkumar Ramachandra.
      
        * Support for Openembedded/Yocto -dbg packages, from Ricardo Ribalda Delgado.
      
        * Implement addr2line directly using libbfd, from Roberto Vitillo.
      
        * Add new option --ignore-vmlinux for perf top, from Willy Tarreau.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1ff9ecf7
    • Ingo Molnar's avatar
      Merge tag 'v3.12-rc5' into perf/core · 426ee9e3
      Ingo Molnar authored
      Merge Linux v3.12-rc5, to pick up the latest fixes.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      426ee9e3
  3. 14 Oct, 2013 24 commits
  4. 13 Oct, 2013 13 commits