Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1583348
| From | Anshuman Khandual <khandual@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 6/6] sysctl: Add global tunable mt_page_copy |
| Date | 2017-02-17 12:30 +0100 |
| Message-ID | <tbOTD-3Eu-17@gated-at.bofh.it> (permalink) |
| References | <tbOTD-3Eu-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Zi Yan <ziy@nvidia.com>
A new global sysctl tunable 'mt_page_copy' is added which will override
syscall specific requests and enable multi threaded page copy during
all migrations on the system. This tunable is disabled by default.
Signed-off-by: Zi Yan <zi.yan@cs.rutgers.edu>
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
kernel/sysctl.c | 10 ++++++++++
mm/migrate.c | 14 ++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 1aea594..e5f7ca9 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -98,6 +98,7 @@
#if defined(CONFIG_SYSCTL)
/* External variables not in a header file. */
+extern int mt_page_copy;
extern int suid_dumpable;
#ifdef CONFIG_COREDUMP
extern int core_uses_pid;
@@ -1346,6 +1347,15 @@ static struct ctl_table vm_table[] = {
.proc_handler = &hugetlb_mempolicy_sysctl_handler,
},
#endif
+ {
+ .procname = "mt_page_copy",
+ .data = &mt_page_copy,
+ .maxlen = sizeof(mt_page_copy),
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ .extra1 = &zero,
+ .extra2 = &one,
+ },
{
.procname = "hugetlb_shm_group",
.data = &sysctl_hugetlb_shm_group,
diff --git a/mm/migrate.c b/mm/migrate.c
index 660c4b2..75b6d7a 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -48,6 +48,8 @@
#include "internal.h"
+int mt_page_copy;
+
/*
* migrate_prep() needs to be called before we start compiling a list of pages
* to be migrated using isolate_lru_page(). If scheduling work on other CPUs is
@@ -611,6 +613,9 @@ static void copy_huge_page(struct page *dst, struct page *src,
nr_pages = hpage_nr_pages(src);
}
+ if (mt_page_copy)
+ mode |= MIGRATE_MT;
+
if (mode & MIGRATE_MT)
rc = copy_pages_mthread(dst, src, nr_pages);
@@ -629,6 +634,9 @@ void migrate_page_copy(struct page *newpage, struct page *page,
{
int cpupid;
+ if (mt_page_copy)
+ mode |= MIGRATE_MT;
+
if (PageHuge(page) || PageTransHuge(page)) {
copy_huge_page(newpage, page, mode);
} else {
@@ -695,6 +703,12 @@ void migrate_page_copy(struct page *newpage, struct page *page,
}
EXPORT_SYMBOL(migrate_page_copy);
+static int __init mt_page_copy_init(void)
+{
+ mt_page_copy = 0;
+ return 0;
+}
+subsys_initcall(mt_page_copy_init);
/************************************************************
* Migration functions
***********************************************************/
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] Enable parallel page migration Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-02-17 12:30 +0100
[PATCH 6/6] sysctl: Add global tunable mt_page_copy Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-02-17 12:30 +0100
Re: [PATCH 6/6] sysctl: Add global tunable mt_page_copy kbuild test robot <lkp@intel.com> - 2017-02-17 16:40 +0100
[PATCH 2/6] mm/migrate: Make migrate_mode types non-exclusive Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-02-17 12:30 +0100
[PATCH 1/6] mm/migrate: Add new mode parameter to migrate_page_copy() function Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-02-17 12:30 +0100
[PATCH 4/6] mm/migrate: Add new migrate mode MIGRATE_MT Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-02-17 12:30 +0100
Re: [PATCH 0/6] Enable parallel page migration Balbir Singh <bsingharora@gmail.com> - 2017-02-22 06:10 +0100
Re: [PATCH 0/6] Enable parallel page migration Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-02-22 07:00 +0100
Re: [PATCH 0/6] Enable parallel page migration Balbir Singh <bsingharora@gmail.com> - 2017-02-22 12:00 +0100
csiph-web