MIPS: Collect FPU emulator statistics per-CPU.
authorDavid Daney <ddaney@caviumnetworks.com>
Thu, 5 Nov 2009 19:34:26 +0000 (11:34 -0800)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 17 Dec 2009 01:57:08 +0000 (01:57 +0000)
commitb6ee75ed4fa201873d3a2b32dfce2dbd701a2de4
tree4574e5e523e9773fb1c8e4e579dc8f3be133daa6
parent32028f1f7bce32e72183129dc55fc23656e7081c
MIPS: Collect FPU emulator statistics per-CPU.

On SMP systems, the collection of statistics can cause cache line
bouncing in the lines associated with the counters.  Also there are
races incrementing the counters on multiple CPUs.

To fix both problems, we collect the statistics in per-CPU variables,
and add them up in the debugfs read operation.

As a test I ran the LTP float_bessel test on a 12 CPU Octeon system.

Without CONFIG_DEBUG_FS :             2602 seconds.
With CONFIG_DEBUG_FS:                 2640 seconds.
With non-cpu-local atomic statistics: 14569 seconds.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/fpu_emulator.h
arch/mips/math-emu/cp1emu.c
arch/mips/math-emu/dsemul.c