* [PATCH] parisc: Add sysctl entry for parisc_cache_flush_threshold
@ 2022-03-12 19:02 Helge Deller
0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2022-03-12 19:02 UTC (permalink / raw)
To: linux-parisc; +Cc: James Bottomley, John David Anglin
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@gmx.de>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-12 19:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12 19:02 [PATCH] parisc: Add sysctl entry for parisc_cache_flush_threshold Helge Deller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.