1. 18 6月, 2009 1 次提交
    • P
      perf_counter: powerpc: Enable use of software counters on 32-bit powerpc · 105988c0
      Paul Mackerras 提交于
      This enables the perf_counter subsystem on 32-bit powerpc.  Since we
      don't have any support for hardware counters on 32-bit powerpc yet,
      only software counters can be used.
      
      Besides selecting HAVE_PERF_COUNTERS for 32-bit powerpc as well as
      64-bit, the main thing this does is add an implementation of
      set_perf_counter_pending().  This needs to arrange for
      perf_counter_do_pending() to be called when interrupts are enabled.
      Rather than add code to local_irq_restore as 64-bit does, the 32-bit
      set_perf_counter_pending() generates an interrupt by setting the
      decrementer to 1 so that a decrementer interrupt will become pending
      in 1 or 2 timebase ticks (if a decrementer interrupt isn't already
      pending).  When interrupts are enabled, timer_interrupt() will be
      called, and some new code in there calls perf_counter_do_pending().
      We use a per-cpu array of flags to indicate whether we need to call
      perf_counter_do_pending() or not.
      
      This introduces a couple of new Kconfig symbols: PPC_HAVE_PMU_SUPPORT,
      which is selected by processor families for which we have hardware PMU
      support (currently only PPC64), and PPC_PERF_CTRS, which enables the
      powerpc-specific perf_counter back-end.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linuxppc-dev@ozlabs.org
      Cc: benh@kernel.crashing.org
      LKML-Reference: <19000.55404.103840.393470@cargo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      105988c0
  2. 17 6月, 2009 2 次提交
  3. 15 6月, 2009 4 次提交
  4. 12 6月, 2009 4 次提交
  5. 11 6月, 2009 6 次提交
  6. 09 6月, 2009 7 次提交
  7. 06 6月, 2009 1 次提交
    • I
      perf_counter: Separate out attr->type from attr->config · a21ca2ca
      Ingo Molnar 提交于
      Counter type is a frequently used value and we do a lot of
      bit juggling by encoding and decoding it from attr->config.
      
      Clean this up by creating a separate attr->type field.
      
      Also clean up the various similarly complex user-space bits
      all around counter attribute management.
      
      The net improvement is significant, and it will be easier
      to add a new major type (which is what triggered this cleanup).
      
      (This changes the ABI, all tools are adapted.)
      (PowerPC build-tested.)
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a21ca2ca
  8. 04 6月, 2009 1 次提交
  9. 03 6月, 2009 4 次提交
    • P
      perf_counter: powerpc: Fix race causing "oops trying to read PMC0" errors · dcd945e0
      Paul Mackerras 提交于
      When using interrupting counters and limited (non-interrupting)
      counters at the same time, it's possible that we get an
      interrupt in write_mmcr0() after writing MMCR0 but before we
      have set up the counters using limited PMCs.  What happens then
      is that we get into perf_counter_interrupt() with
      counter->hw.idx = 0 for the limited counters, leading to the
      "oops trying to read PMC0" error message being printed.
      
      This fixes the problem by making perf_counter_interrupt()
      robust against counter->hw.idx being zero (the counter is just
      ignored in that case) and also by changing write_mmcr0() to
      write MMCR0 initially with the counter overflow interrupt
      enable bits masked (set to 0).  If the MMCR0 value requested by
      the caller has either of those bits set, we write MMCR0 again
      with the requested value of those bits after setting up the
      limited counters properly.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Stephane Eranian <eranian@googlemail.com>
      LKML-Reference: <18982.17684.138182.954599@cargo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dcd945e0
    • P
      perf_counter: powerpc: Fix event alternative code generation on POWER5/5+ · 6984efb6
      Paul Mackerras 提交于
      Commit ef923214 ("perf_counter: powerpc: use u64 for event
      codes internally") introduced a bug where the return value from
      function find_alternative_bdecode gets put into a u64 variable
      and later tested to see if it is < 0.  The effect is that we
      get extra, bogus event code alternatives on POWER5 and POWER5+,
      leading to error messages such as "oops compute_mmcr failed"
      being printed and counters not counting properly.
      
      This fixes it by using s64 for the return type of
      find_alternative_bdecode and for the local variable that the
      caller puts the value in.  It also makes the event argument a
      u64 on POWER5+ for consistency.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Stephane Eranian <eranian@googlemail.com>
      LKML-Reference: <18982.17586.666132.90983@cargo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6984efb6
    • P
      perf_counter: Rename perf_counter_hw_event => perf_counter_attr · 0d48696f
      Peter Zijlstra 提交于
      The structure isn't hw only and when I read event, I think about those
      things that fall out the other end. Rename the thing.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Stephane Eranian <eranian@googlemail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0d48696f
    • P
      perf_counter: Rename various fields · b23f3325
      Peter Zijlstra 提交于
      A few renames:
      
        s/irq_period/sample_period/
        s/irq_freq/sample_freq/
        s/PERF_RECORD_/PERF_SAMPLE_/
        s/record_type/sample_type/
      
      And change both the new sample_type and read_format to u64.
      Reported-by: NStephane Eranian <eranian@googlemail.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b23f3325
  10. 02 6月, 2009 5 次提交
  11. 27 5月, 2009 1 次提交
    • B
      powerpc: Fix up dma_alloc_coherent() on platforms without cache coherency. · 8b31e49d
      Benjamin Herrenschmidt 提交于
      The implementation we just revived has issues, such as using a
      Kconfig-defined virtual address area in kernel space that nothing
      actually carves out (and thus will overlap whatever is there),
      or having some dependencies on being self contained in a single
      PTE page which adds unnecessary constraints on the kernel virtual
      address space.
      
      This fixes it by using more classic PTE accessors and automatically
      locating the area for consistent memory, carving an appropriate hole
      in the kernel virtual address space, leaving only the size of that
      area as a Kconfig option. It also brings some dma-mask related fixes
      from the ARM implementation which was almost identical initially but
      grew its own fixes.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8b31e49d
  12. 26 5月, 2009 1 次提交
    • P
      perf_counter: powerpc: Implement interrupt throttling · 8a7b8cb9
      Paul Mackerras 提交于
      This implements interrupt throttling on powerpc.  Since we don't have
      individual count enable/disable or interrupt enable/disable controls
      per counter, this simply sets the hardware counter to 0, meaning that
      it will not interrupt again until it has counted 2^31 counts, which
      will take at least 2^30 cycles assuming a maximum of 2 counts per
      cycle.  Also, we set counter->hw.period_left to the maximum possible
      value (2^63 - 1), so we won't report overflows for this counter for
      the forseeable future.
      
      The unthrottle operation restores counter->hw.period_left and the
      hardware counter so that we will once again report a counter overflow
      after counter->hw.irq_period counts.
      
      [ Impact: new perfcounters robustness feature on PowerPC ]
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      LKML-Reference: <18971.35823.643362.446774@cargo.ozlabs.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8a7b8cb9
  13. 21 5月, 2009 3 次提交
    • G
      powerpc: Keep track of emulated instructions · 80947e7c
      Geert Uytterhoeven 提交于
      If CONFIG_PPC_EMULATED_STATS is enabled, make available counters for the
      various classes of emulated instructions under
      /sys/kernel/debug/powerpc/emulated_instructions/ (assumed debugfs is mounted on
      /sys/kernel/debug).  Optionally (controlled by
      /sys/kernel/debug/powerpc/emulated_instructions/do_warn), rate-limited warnings
      can be printed to the console when instructions are emulated.
      Signed-off-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      80947e7c
    • A
      powerpc: Improve decrementer accuracy · 8d165db1
      Anton Blanchard 提交于
      I have been looking at sources of OS jitter and notice that after a long
      NO_HZ idle period we wakeup too early:
      
      relative time (us)    event
                            timer irq exit
          999946.405        timer irq entry
               4.835        timer irq exit
              21.685        timer irq entry
               3.540          timer (tick_sched_timer) entry
      
      Here we slept for just under a second then took a timer interrupt that did
      nothing. 21.685 us later we wake up again and do the work.
      
      We set a rather low shift value of 16 for the decrementer clockevent, which I
      think is causing this issue. On this box we have a 207MHz decrementer and see:
      
      clockevent: decrementer mult[3501] shift[16] cpu[0]
      
      For calculations of large intervals this mult/shift combination could be
      off by a significant amount. I notice the sparc code has a loop that iterates
      to find a mult/shift combination that maximises the shift value while
      keeping mult under 32bit. With the patch below we get:
      
      clockevent: decrementer mult[35015c20] shift[32] cpu[15]
      
      And we no longer see the spurious wakeups.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8d165db1
    • K
      powerpc/pci: Remove redundant pcnet32 fixup · 9aa4e7b1
      Kumar Gala 提交于
      The pcnet32 driver has had in its device id table for some time a match
      against the "broken" vendor ID.  No need to fake out the vendor ID
      with an explicit fixup.
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      9aa4e7b1