linux-stable/arch/csky/abiv2
Guo Ren 1f62ed00a5 csky: mmu: Prevent spurious page faults
C-SKY MMU would pre-fetch invalid pte entries, and it could work with
flush_tlb_fix_spurious_fault, but the additional page fault exceptions
would reduce performance. So flushing the entry of the TLB would prevent
the following spurious page faults. Here is the test code:

define DATA_LEN  4096
define COPY_NUM  (504*100)

unsigned char src[DATA_LEN*COPY_NUM] = {0};
unsigned char dst[DATA_LEN*COPY_NUM] = {0};

unsigned char func_src[DATA_LEN*COPY_NUM] = {0};
unsigned char func_dst[DATA_LEN*COPY_NUM] = {0};

void main(void)
{
	int j;
	for (j = 0; j < COPY_NUM; j++)
		memcpy(&dst[j*DATA_LEN], &src[j*DATA_LEN], 4);
}

perf stat -e page-faults ./main.elf

The amount of page fault traps would be reduced in half with the patch.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
2023-04-13 02:36:14 -04:00
..
inc/abi csky/mm: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE 2023-02-02 22:33:06 -08:00
cacheflush.c csky: mmu: Prevent spurious page faults 2023-04-13 02:36:14 -04:00
fpu.c csky: Fixup init_fpu compile warning with __init 2020-03-08 20:55:14 +08:00
Makefile csky: Add C based string functions 2022-04-18 21:23:55 +08:00
mcount.S csky: Fixup kprobes handler couldn't change pc 2020-07-31 01:51:57 +00:00
memcmp.S csky: Library functions 2018-10-26 00:54:24 +08:00
memcpy.S csky: fixup remove vdsp implement for kernel. 2018-12-31 22:56:59 +08:00
memmove.S csky: Fixup vdsp&fpu issues in kernel 2019-04-22 13:44:57 +08:00
memset.S csky: Library functions 2018-10-26 00:54:24 +08:00
strcmp.S csky: Library functions 2018-10-26 00:54:24 +08:00
strcpy.S csky: Library functions 2018-10-26 00:54:24 +08:00
strksyms.c csky: Add C based string functions 2022-04-18 21:23:55 +08:00
strlen.S csky: Library functions 2018-10-26 00:54:24 +08:00
sysdep.h csky: Fixup compile error 2021-02-27 22:04:14 +08:00