From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: mhocko@suse.com, vbabka@suse.cz, mgorman@suse.de,
minchan@kernel.org, aneesh.kumar@linux.vnet.ibm.com,
bsingharora@gmail.com, srikar@linux.vnet.ibm.com,
haren@linux.vnet.ibm.com, jglisse@redhat.com,
dave.hansen@intel.com, dan.j.williams@intel.com,
zi.yan@cs.rutgers.edu
Subject: [PATCH 6/6] sysctl: Add global tunable mt_page_copy
Date: Fri, 17 Feb 2017 16:54:53 +0530 [thread overview]
Message-ID: <20170217112453.307-7-khandual@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170217112453.307-1-khandual@linux.vnet.ibm.com>
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
next prev parent reply other threads:[~2017-02-17 11:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 11:24 [PATCH 0/6] Enable parallel page migration Anshuman Khandual
2017-02-17 11:24 ` [PATCH 1/6] mm/migrate: Add new mode parameter to migrate_page_copy() function Anshuman Khandual
2017-03-09 6:24 ` Anshuman Khandual
2017-02-17 11:24 ` [PATCH 2/6] mm/migrate: Make migrate_mode types non-exclusive Anshuman Khandual
2017-02-17 11:24 ` [PATCH 3/6] mm/migrate: Add copy_pages_mthread function Anshuman Khandual
2017-02-17 12:27 ` kbuild test robot
2017-03-08 15:40 ` Anshuman Khandual
2017-03-09 6:25 ` Anshuman Khandual
2017-02-17 11:24 ` [PATCH 4/6] mm/migrate: Add new migrate mode MIGRATE_MT Anshuman Khandual
2017-02-17 11:24 ` [PATCH 5/6] mm/migrate: Add new migration flag MPOL_MF_MOVE_MT for syscalls Anshuman Khandual
2017-03-09 6:26 ` Anshuman Khandual
2017-02-17 11:24 ` Anshuman Khandual [this message]
2017-02-17 15:30 ` [PATCH 6/6] sysctl: Add global tunable mt_page_copy kbuild test robot
2017-03-08 15:37 ` Anshuman Khandual
2017-03-10 1:12 ` [kbuild-all] " Ye Xiaolong
2017-03-10 12:11 ` Anshuman Khandual
2017-02-22 5:04 ` [PATCH 0/6] Enable parallel page migration Balbir Singh
2017-02-22 5:55 ` Anshuman Khandual
2017-02-22 10:52 ` Balbir Singh
2017-03-08 16:04 ` Anshuman Khandual
2017-03-09 15:09 ` Mel Gorman
2017-03-09 17:38 ` David Nellans
2017-03-09 22:15 ` Mel Gorman
2017-03-09 23:46 ` Zi Yan
2017-03-10 14:07 ` Mel Gorman
2017-03-10 14:45 ` Michal Hocko
2017-03-10 13:05 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170217112453.307-7-khandual@linux.vnet.ibm.com \
--to=khandual@linux.vnet.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=bsingharora@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@intel.com \
--cc=haren@linux.vnet.ibm.com \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=srikar@linux.vnet.ibm.com \
--cc=vbabka@suse.cz \
--cc=zi.yan@cs.rutgers.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).