linux_dsm_epyc7002/arch/powerpc
Christophe Leroy 0e36b0d125 powerpc/mm: Only read faulting instruction when necessary in do_page_fault()
Commit a7a9dcd882 ("powerpc: Avoid taking a data miss on every
userspace instruction miss") has shown that limiting the read of
faulting instruction to likely cases improves performance.

This patch goes further into this direction by limiting the read
of the faulting instruction to the only cases where it is likely
needed.

On an MPC885, with the same benchmark app as in the commit referred
above, we see a reduction of about 3900 dTLB misses (approx 3%):

Before the patch:
 Performance counter stats for './fault 500' (10 runs):

         683033312      cpu-cycles                                                    ( +-  0.03% )
            134538      dTLB-load-misses                                              ( +-  0.03% )
             46099      iTLB-load-misses                                              ( +-  0.02% )
             19681      faults                                                        ( +-  0.02% )

       5.389747878 seconds time elapsed                                          ( +-  0.06% )

With the patch:

 Performance counter stats for './fault 500' (10 runs):

         682112862      cpu-cycles                                                    ( +-  0.03% )
            130619      dTLB-load-misses                                              ( +-  0.03% )
             46073      iTLB-load-misses                                              ( +-  0.05% )
             19681      faults                                                        ( +-  0.01% )

       5.381342641 seconds time elapsed                                          ( +-  0.07% )

The proper work of the huge stack expansion was tested with the
following app:

int main(int argc, char **argv)
{
	char buf[1024 * 1025];

	sprintf(buf, "Hello world !\n");
	printf(buf);

	exit(0);
}

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Add include of pagemap.h to fix build errors]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-05-25 00:08:25 +10:00
..
boot powerpc/fsl/dts: fix the i2c-mux compatible for t104xqds 2018-05-21 14:48:01 +10:00
configs powerpc/config: powernv_defconfig updates 2018-05-10 23:25:07 +10:00
crypto
include powerpc/mm: Use instruction symbolic names in store_updates_sp() 2018-05-25 00:08:24 +10:00
kernel powerpc/ptrace: Fix setting 512B aligned breakpoints with PTRACE_SET_DEBUGREG 2018-05-21 14:48:01 +10:00
kvm Merge branch 'topic/ppc-kvm' into next 2018-05-15 22:28:19 +10:00
lib powerpc/lib: Fix "integer constant is too large" build failure 2018-05-18 16:04:02 +10:00
math-emu
mm powerpc/mm: Only read faulting instruction when necessary in do_page_fault() 2018-05-25 00:08:25 +10:00
net
oprofile
perf powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus() 2018-05-18 21:57:49 +10:00
platforms powernv: opal-sensor: Add support to read 64bit sensor values 2018-05-21 14:48:02 +10:00
purgatory
sysdev powerpc/xive: prepare all hcalls to support long busy delays 2018-05-10 23:25:10 +10:00
tools
xmon
Kconfig powerpc/livepatch: Implement reliable stack tracing for the consistency model 2018-05-10 23:25:12 +10:00
Kconfig.debug
Makefile
Makefile.postlink