aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/sysfs.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2009-09-09 20:28:49 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-24 08:43:55 -0700
commit56033c44ce563bebf3cdde976ba0f0c5c3720b2f (patch)
treee65c07c72485db1765a38b442761b6227c6fd602 /arch/powerpc/kernel/sysfs.c
parent9db85a343cebff62b7d9e3448502a64b26ee1164 (diff)
powerpc/perf_counters: Reduce stack usage of power_check_constraints
commit e51ee31e8af22948dcc3b115978469b09c96c3fd upstream. 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> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/powerpc/kernel/sysfs.c')
0 files changed, 0 insertions, 0 deletions