Files
android_kernel_xiaomi_sm8450/arch/powerpc/kernel
Paul Mackerras e51ee31e8a powerpc/perf_counters: Reduce stack usage of power_check_constraints
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: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: <stable@kernel.org)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-09-11 11:27:59 +10:00
..
2009-08-20 10:29:28 +10:00
2009-08-20 10:29:28 +10:00
2007-05-11 05:38:25 -04:00
2008-06-30 22:31:00 +10:00
2009-08-28 14:24:10 +10:00
2009-08-28 14:24:10 +10:00
2009-06-16 19:47:28 -07:00
2008-05-23 22:43:11 +02:00
2009-06-12 16:53:38 +10:00
2009-07-12 12:22:34 -07:00
2008-12-21 14:21:16 +11:00
2009-08-20 10:12:34 +10:00
2007-10-11 14:36:47 +10:00
2009-08-28 14:24:10 +10:00