]> git.karo-electronics.de Git - karo-tx-linux.git/commit
powerpc/perf/hv-24x7: Use per-cpu page buffer
authorsukadev@linux.vnet.ibm.com <sukadev@linux.vnet.ibm.com>
Wed, 10 Dec 2014 22:29:13 +0000 (14:29 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 12 Dec 2014 05:05:18 +0000 (16:05 +1100)
commitf34b6c72c3ebaa286d3311a825ef79eccbcca82f
tree89253e6c8d36e453e20a8de62cc11ebd34dd4366
parentb123429e6a9e8d03aacf888d23262835f0081448
powerpc/perf/hv-24x7: Use per-cpu page buffer

The 24x7 counters are continuously running and not updated on an
interrupt. So we record the event counts when stopping the event or
deleting it.

But to "read" a single counter in 24x7, we allocate a page and pass it
into the hypervisor (The HV returns the page full of counters from which
we extract the specific counter for this event).

We allocate a page using GFP_USER and when deleting the event, we end up
with the following warning because we are blocking in interrupt context.

  [  698.641709] BUG: scheduling while atomic: swapper/0/0/0x10010000

We could use GFP_ATOMIC but that could result in failures. Pre-allocate
a buffer so we don't have to allocate in interrupt context. Further as
Michael Ellerman suggested, use Per-CPU buffer so we only need to
allocate once per CPU.

Cc: stable@vger.kernel.org
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/perf/hv-24x7.c