Add the sysctl entry /proc/sys/kernel/cache_flush_threshold which allows the user to modify the threshold above which the kernel will flush all CPU caches, instead of manually flushing only specific memory areas. Signed-off-by: Helge Deller <deller@xxxxxx> --- arch/parisc/kernel/cache.c | 2 +- include/linux/sysctl.h | 1 + kernel/sysctl.c | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 81f36d6407f0..3f0f554d3edd 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -379,7 +379,7 @@ EXPORT_SYMBOL(flush_data_cache_local); EXPORT_SYMBOL(flush_kernel_icache_range_asm); #define FLUSH_THRESHOLD 0x80000 /* 0.5MB */ -static unsigned long parisc_cache_flush_threshold __ro_after_init = FLUSH_THRESHOLD; +unsigned long parisc_cache_flush_threshold = FLUSH_THRESHOLD; #define FLUSH_TLB_THRESHOLD (16*1024) /* 16 KiB minimum TLB threshold */ static unsigned long parisc_tlb_flush_threshold __ro_after_init = ~0UL; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 6353d6db69b2..771e56d47bab 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -243,6 +243,7 @@ int do_proc_douintvec(struct ctl_table *table, int write, void *data); extern int pwrsw_enabled; +extern unsigned long parisc_cache_flush_threshold; extern int unaligned_enabled; extern int unaligned_dump_stack; extern int no_unaligned_warning; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 5ae443b2882e..b2acfc6640d0 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1889,6 +1889,13 @@ static struct ctl_table kern_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, + { + .procname = "cache_flush_threshold", + .data = &parisc_cache_flush_threshold, + .maxlen = sizeof (unsigned long), + .mode = 0644, + .proc_handler = proc_doulongvec_minmax, + }, #endif #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW { -- 2.34.1