[RFC PATCH 06/25] mm: migrate: Make the number of copy threads adjustable via sysctl.
From: Zi Yan
Date: Wed Apr 03 2019 - 22:14:47 EST
From: Zi Yan <ziy@xxxxxxxxxx>
Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---
kernel/sysctl.c | 9 +++++++++
mm/copy_page.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 3d8490e..0eae0b8 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -102,6 +102,7 @@
#if defined(CONFIG_SYSCTL)
extern int accel_page_copy;
+extern unsigned int limit_mt_num;
/* External variables not in a header file. */
extern int suid_dumpable;
@@ -1441,6 +1442,14 @@ static struct ctl_table vm_table[] = {
.extra1 = &zero,
.extra2 = &one,
},
+ {
+ .procname = "limit_mt_num",
+ .data = &limit_mt_num,
+ .maxlen = sizeof(limit_mt_num),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ .extra1 = &zero,
+ },
{
.procname = "hugetlb_shm_group",
.data = &sysctl_hugetlb_shm_group,
diff --git a/mm/copy_page.c b/mm/copy_page.c
index 9cf849c..6665e3d 100644
--- a/mm/copy_page.c
+++ b/mm/copy_page.c
@@ -23,7 +23,7 @@
#include <linux/freezer.h>
-const unsigned int limit_mt_num = 4;
+unsigned int limit_mt_num = 4;
/* ======================== multi-threaded copy page ======================== */
--
2.7.4