1. 11 Sep, 2009 4 commits
    • Paul Mackerras's avatar
      powerpc/perf_counters: Reduce stack usage of power_check_constraints · e51ee31e
      Paul Mackerras authored
      Michael Ellerman reported stack-frame size warnings being produced
      for power_check_constraints(), which uses an 8*8 array of u64 and
      two 8*8 arrays of unsigned long, which are currently allocated on the
      stack, along with some other smaller variables.  These arrays come
      to 1.5kB on 64-bit or 1kB on 32-bit, which is a bit too much for the
      stack.
      
      This fixes the problem by putting these arrays in the existing
      per-cpu cpu_hw_counters struct.  This is OK because two of the call
      sites have interrupts disabled already; for the third call site we
      use get_cpu_var, which disables preemption, so we know we won't
      get a context switch while we're in power_check_constraints().
      Note that power_check_constraints() can be called during context
      switch but is not called from interrupts.
      Reported-by: default avatarMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: <stable@kernel.org)
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e51ee31e
    • Paul Mackerras's avatar
      powerpc: Fix bug where perf_counters breaks oprofile · a6dbf93a
      Paul Mackerras authored
      Currently there is a bug where if you use oprofile on a pSeries
      machine, then use perf_counters, then use oprofile again, oprofile
      will not work correctly; it will lose the PMU configuration the next
      time the hypervisor does a partition context switch, and thereafter
      won't count anything.
      
      Maynard Johnson identified the sequence causing the problem:
      - oprofile setup calls ppc_enable_pmcs(), which calls
        pseries_lpar_enable_pmcs, which tells the hypervisor that we want
        to use the PMU, and sets the "PMU in use" flag in the lppaca.
        This flag tells the hypervisor whether it needs to save and restore
        the PMU config.
      - The perf_counter code sets and clears the "PMU in use" flag directly
        as it context-switches the PMU between tasks, and leaves it clear
        when it finishes.
      - oprofile setup, called for a new oprofile run, calls ppc_enable_pmcs,
        which does nothing because it has already been called.  In particular
        it doesn't set the "PMU in use" flag.
      
      This fixes the problem by arranging for ppc_enable_pmcs to always set
      the "PMU in use" flag.  It makes the perf_counter code call
      ppc_enable_pmcs also rather than calling the lower-level function
      directly, and removes the setting of the "PMU in use" flag from
      pseries_lpar_enable_pmcs, since that is now done in its caller.
      
      This also removes the declaration of pasemi_enable_pmcs because it
      isn't defined anywhere.
      Reported-by: default avatarMaynard Johnson <mpjohn@us.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: <stable@kernel.org)
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a6dbf93a
    • Kumar Gala's avatar
      powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops · 757cbd46
      Kumar Gala authored
      The following commit introduced a compile error since it removed
      the implementation of smp_85xx_basic_setup:
      
      commit 77c0a700
      Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Date:   Fri Aug 28 14:25:04 2009 +1000
      
          powerpc: Properly start decrementer on BookE secondary CPUs
      
      Make it so that smp_ops probe() and setup_cpu() can be set to NULL.
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      757cbd46
    • Wolfram Sang's avatar
      powerpc/irq: Improve nanodoc · 8708d002
      Wolfram Sang authored
      The OF helpers look like nanodoc but are missing the header. Fix this and a
      typo (s/nad/and/) while we are here.
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8708d002
  2. 02 Sep, 2009 6 commits
  3. 31 Aug, 2009 6 commits
  4. 28 Aug, 2009 21 commits
  5. 27 Aug, 2009 3 commits
    • Benjamin Herrenschmidt's avatar
      3c2ee2d9
    • Gautham R Shenoy's avatar
      powerpc/pseries: Reduce the polling interval in __cpu_up() · 67764263
      Gautham R Shenoy authored
      Time time taken for a single cpu online operation on a pseries machine
      is as follows:
      Dedicated LPAR (POWER6): ~220ms.
      Shared LPAR (POWER5)   : ~240ms.
      
      Of this time, approximately 200ms is taken up by __cpu_up(). This is because
      we poll every 200ms to check if the new cpu has notified it's presence
      through the cpu_callin_map. We repeat this operation until the new cpu sets
      the value in cpu_callin_map or 5 seconds elapse, whichever comes earlier.
      
      However, using completion_structs instead of polling loops,
      the time taken by the new processor to indicate it's presence has
      found to be less than 1ms on pseries. This method however may not
      work on all powerpc platforms due to the time-base synchronization code.
      
      Keeping this in mind, we could reduce msleep polling interval from
      200ms to 1ms while retaining the 5 second timeout.
      
      With this, the time taken for a cpu online operation changes as follows:
      Dedicated LPAR (POWER6): 20-25ms.
      Shared LPAR (POWER5)   : 60-80ms.
      
      In both these cases, it was found that the code polls through the loop
      only once indicating that 1ms is a reasonable value, atleast on pseries.
      
      The code needs testing on other powerpc platforms.
      Signed-off-by: default avatarGautham R Shenoy <ego@in.ibm.com>
      Acked-by: default avatarJoel Schopp <jschopp@austin.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      67764263
    • Bastian Blank's avatar
      powerpc: Remove SMP warning from PowerMac cpufreq · 6fdc31a2
      Bastian Blank authored
      On Thu, Aug 13, 2009 at 04:14:58PM +1000, Benjamin Herrenschmidt wrote:
      > On Tue, 2009-08-11 at 11:39 +0200, Bastian Blank wrote:
      > > This patch just disables this driver on SMP kernels, as it is obviously
      > > not supported.
      > Why not remove the #error instead ? :-) I don't think it's still
      > meaningful, especially since we use the timebase for delays nowadays
      > which doesn't depend on the CPU frequency...
      
      Your call. Take this one:
      
      The build of a PowerMac 32bit kernel currently fails with
      
      error: #warning "WARNING, CPUFREQ not recommended on SMP kernels"
      
      Thie patch removes the not longer applicable SMP warning from the
      PowerMac cpufreq code.
      Signed-off-by: default avatarBastian Blank <waldi@debian.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6fdc31a2