powerpc/signal: Don't manage floating point regs when no FPU
There is no point in copying floating point regs when there is no FPU and MATH_EMULATION is not selected. Create a new CONFIG_PPC_FPU_REGS bool that is selected by CONFIG_MATH_EMULATION and CONFIG_PPC_FPU, and use it to opt out everything related to fp_state in thread_struct. The asm const used only by fpu.S are opted out with CONFIG_PPC_FPU as fpu.S build is conditionnal to CONFIG_PPC_FPU. The following app spends approx 8.1 seconds system time on an 8xx without the patch, and 7.0 seconds with the patch (13.5% reduction). On an 832x, it spends approx 2.6 seconds system time without the patch and 2.1 seconds with the patch (19% reduction). void sigusr1(int sig) { } int main(int argc, char **argv) { int i = 100000; signal(SIGUSR1, sigusr1); for (;i--;) raise(SIGUSR1); exit(0); } Signed-off-by:Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by:
Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/7569070083e6cd5b279bb5023da601aba3c06f3c.1597770847.git.christophe.leroy@csgroup.eu
Showing
- arch/powerpc/Kconfig 1 addition, 0 deletionsarch/powerpc/Kconfig
- arch/powerpc/include/asm/processor.h 2 additions, 0 deletionsarch/powerpc/include/asm/processor.h
- arch/powerpc/kernel/asm-offsets.c 2 additions, 0 deletionsarch/powerpc/kernel/asm-offsets.c
- arch/powerpc/kernel/process.c 4 additions, 0 deletionsarch/powerpc/kernel/process.c
- arch/powerpc/kernel/ptrace/Makefile 2 additions, 2 deletionsarch/powerpc/kernel/ptrace/Makefile
- arch/powerpc/kernel/ptrace/ptrace-decl.h 14 additions, 0 deletionsarch/powerpc/kernel/ptrace/ptrace-decl.h
- arch/powerpc/kernel/ptrace/ptrace-view.c 2 additions, 0 deletionsarch/powerpc/kernel/ptrace/ptrace-view.c
- arch/powerpc/kernel/signal.h 13 additions, 1 deletionarch/powerpc/kernel/signal.h
- arch/powerpc/kernel/signal_32.c 4 additions, 0 deletionsarch/powerpc/kernel/signal_32.c
- arch/powerpc/kernel/traps.c 2 additions, 0 deletionsarch/powerpc/kernel/traps.c
- arch/powerpc/platforms/Kconfig.cputype 4 additions, 0 deletionsarch/powerpc/platforms/Kconfig.cputype
Loading
Please register or sign in to comment