]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Thu, 12 Aug 2021 13:28:30 +0000 (18:58 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 13 Aug 2021 12:04:26 +0000 (22:04 +1000)
Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling.
Also add a debugfs entry for tlb_local_single_page_flush_ceiling.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210812132831.233794-1-aneesh.kumar@linux.ibm.com
arch/powerpc/mm/book3s64/radix_tlb.c

index aefc100d79a7c0f01ef0fbe645a44a9d2d62e126..1fa2bc6a969eed74db35aec636cd328160b67b2d 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/trace.h>
 #include <asm/cputhreads.h>
 #include <asm/plpar_wrappers.h>
+#include <asm/debugfs.h>
 
 #include "internal.h"
 
@@ -1106,8 +1107,8 @@ EXPORT_SYMBOL(radix__flush_tlb_kernel_range);
  * invalidating a full PID, so it has a far lower threshold to change from
  * individual page flushes to full-pid flushes.
  */
-static unsigned long tlb_single_page_flush_ceiling __read_mostly = 33;
-static unsigned long tlb_local_single_page_flush_ceiling __read_mostly = POWER9_TLB_SETS_RADIX * 2;
+static u32 tlb_single_page_flush_ceiling __read_mostly = 33;
+static u32 tlb_local_single_page_flush_ceiling __read_mostly = POWER9_TLB_SETS_RADIX * 2;
 
 static inline void __radix__flush_tlb_range(struct mm_struct *mm,
                                            unsigned long start, unsigned long end)
@@ -1524,3 +1525,14 @@ void do_h_rpt_invalidate_prt(unsigned long pid, unsigned long lpid,
 EXPORT_SYMBOL_GPL(do_h_rpt_invalidate_prt);
 
 #endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
+
+static int __init create_tlb_single_page_flush_ceiling(void)
+{
+       debugfs_create_u32("tlb_single_page_flush_ceiling", 0600,
+                          powerpc_debugfs_root, &tlb_single_page_flush_ceiling);
+       debugfs_create_u32("tlb_local_single_page_flush_ceiling", 0600,
+                          powerpc_debugfs_root, &tlb_local_single_page_flush_ceiling);
+       return 0;
+}
+late_initcall(create_tlb_single_page_flush_ceiling);
+