From 74c53b5717ba762d8648ee9e3d961093df2d7300 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Thu, 30 Mar 2023 13:07:10 +0200 Subject: csky: remove obsolete config CPU_TLB_SIZE Commit 9d35dc3006a9 ("csky: Revert mmu ASID mechanism") removes the only use of CONFIG_CPU_TLB_SIZE. Since then, this config has no effect and can be deleted. Remove the obsolete config CPU_TLB_SIZE. Signed-off-by: Lukas Bulwahn Signed-off-by: Guo Ren --- arch/csky/Kconfig | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/csky') diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig index dba02da6fa34..1fb5f066a885 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -166,11 +166,6 @@ config STACKTRACE_SUPPORT config TIME_LOW_RES def_bool y -config CPU_TLB_SIZE - int - default "128" if (CPU_CK610 || CPU_CK807 || CPU_CK810) - default "1024" if (CPU_CK860) - config CPU_ASID_BITS int default "8" if (CPU_CK610 || CPU_CK807 || CPU_CK810) -- cgit From 1f62ed00a56bf01becaccd81bf30f2fcb0322fd2 Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Thu, 6 Apr 2023 04:46:49 -0400 Subject: 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 Signed-off-by: Guo Ren --- arch/csky/abiv1/cacheflush.c | 3 +++ arch/csky/abiv2/cacheflush.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'arch/csky') diff --git a/arch/csky/abiv1/cacheflush.c b/arch/csky/abiv1/cacheflush.c index fb91b069dc69..94fbc03cbe70 100644 --- a/arch/csky/abiv1/cacheflush.c +++ b/arch/csky/abiv1/cacheflush.c @@ -11,6 +11,7 @@ #include #include #include +#include #define PG_dcache_clean PG_arch_1 @@ -40,6 +41,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn = pte_pfn(*ptep); struct page *page; + flush_tlb_page(vma, addr); + if (!pfn_valid(pfn)) return; diff --git a/arch/csky/abiv2/cacheflush.c b/arch/csky/abiv2/cacheflush.c index 39c51399dd81..9923cd24db58 100644 --- a/arch/csky/abiv2/cacheflush.c +++ b/arch/csky/abiv2/cacheflush.c @@ -5,6 +5,7 @@ #include #include #include +#include void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *pte) @@ -12,6 +13,8 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, unsigned long addr; struct page *page; + flush_tlb_page(vma, address); + if (!pfn_valid(pte_pfn(*pte))) return; -- cgit