Skip to contentSkip to conversation

parisc: Add sysctl entry for parisc_cache_flush_threshold

PATCH New Helge Deller 1 participant 1 message Mar 12, 2022

Subsystems (2)
lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Add sysctl entry for parisc_cache_flush_threshold

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.

---
 arch/parisc/kernel/cache.c | 2 +-
 include/linux/sysctl.h     | 1 +
 kernel/sysctl.c            | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)
arch/parisc/kernel/cache.c +1 -1
index 81f36d6407f0..3f0f554d3edd 100644
@@ -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;
include/linux/sysctl.h +1 -0
index 6353d6db69b2..771e56d47bab 100644
@@ -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;
kernel/sysctl.c +7 -0
index 5ae443b2882e..b2acfc6640d0 100644
@@ -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