linux-kernel-test/arch
Giuseppe CAVALLARO a0458b07c1 sh: add sleazy FPU optimization
sh port of the sLeAZY-fpu feature currently implemented for some architectures
such us i386.

Right now the SH kernel has a 100% lazy fpu behaviour.
This is of course great for applications that have very sporadic or no FPU use.
However for very frequent FPU users...  you take an extra trap every context
switch.
The patch below adds a simple heuristic to this code: after 5 consecutive
context switches of FPU use, the lazy behavior is disabled and the context
gets restored every context switch.
After 256 switches, this is reset and the 100% lazy behavior is returned.

Tests with LMbench showed no regression.
I saw a little improvement due to the prefetching (~2%).

The tests below also show that, with this sLeazy patch, indeed,
the number of FPU exceptions is reduced.
To test this. I hacked the lat_ctx LMBench to use the FPU a little more.

   sLeasy implementation
   ===========================================
   switch_to calls            |  79326
   sleasy   calls             |  42577
   do_fpu_state_restore  calls|  59232
   restore_fpu   calls        |  59032

   Exceptions:  0x800 (FPU disabled  ): 16604

   100% Leazy (default implementation)
   ===========================================
   switch_to  calls            |  79690
   do_fpu_state_restore calls  |  53299
   restore_fpu  calls          |   53101

   Exceptions: 0x800 (FPU disabled  ):  53273

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-11-24 16:23:38 +09:00
..
alpha Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc 2009-11-17 09:14:49 -08:00
arm Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2009-11-18 15:00:21 -08:00
avr32 at91: at91sam9g45 family: identify several chip versions 2009-11-03 18:42:31 +01:00
blackfin headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
cris const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
frv frv: fix check on unsigned in do_signal() 2009-10-29 07:39:32 -07:00
h8300 h8300: Cleanup linker script using new linker script macros. 2009-09-24 17:16:22 -07:00
ia64 Revert "[IA64] fix percpu warnings" 2009-11-02 09:23:08 -08:00
m32r m32r: fix arch/m32r/boot/compressed/Makefile 2009-11-09 09:00:50 +09:00
m68k tty: Mark generic_serial users as BROKEN 2009-10-30 14:43:12 -07:00
m68knommu m68knommu: fix rename of pt_regs offset defines breakage 2009-09-30 10:06:07 +10:00
microblaze microblaze: Clear sticky FSR register after saving it to func parametr 2009-10-05 11:37:47 +02:00
mips MIPS: SMTC: Fix lockup in smtc_distribute_timer 2009-11-13 18:10:38 +01:00
mn10300 mn10300: fix kernel build failures when using gcc-4.x 2009-10-01 16:11:12 -07:00
parisc fcntl: Use consistent values for F_[GS]ETOWN_EX 2009-11-17 09:13:43 -08:00
powerpc Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc 2009-11-17 09:14:49 -08:00
s390 [S390] s390: fix single stepping on svc0 2009-11-13 15:45:03 +01:00
score Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next 2009-09-23 15:37:02 -07:00
sh sh: add sleazy FPU optimization 2009-11-24 16:23:38 +09:00
sparc Merge branch 'hostprogs-wmissing-prototypes' of git://git.kernel.org/pub/scm/linux/kernel/git/josh/linux-misc 2009-11-17 09:14:49 -08:00
um headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
x86 [CPUFREQ] speedstep-ich: fix error caused by 394122ab14 2009-11-17 23:15:04 -05:00
xtensa headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
.gitignore
Kconfig