From: Lee Schermerhorn <lee.schermerhorn@hp.com>
To: linux-mm <linux-mm@kvack.org>
Subject: [PATCH/RFC] AutoPage Migration - V0.1 - 8/8 hook automigration to migrate-on-fault
Date: Fri, 10 Mar 2006 14:59:30 -0500 [thread overview]
Message-ID: <1142020770.5204.34.camel@localhost.localdomain> (raw)
AutoPage Migration - V0.1 - 8/8 hook automigration to migrate-on-fault
N.B., this patch depends on the "migrate-on-fault" patch series.
Add a /sys/kernel/migration control--sched_migrate_lazy--to use
migrate-on-fault when sched_migrate_memory enabled.
Modify migrate_vma_to_node() to just unmap the eligible pages
via migrate_pages_unmap_only() when sched_migrate_lazy enabled.
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Index: linux-2.6.16-rc5-git11/mm/mempolicy.c
===================================================================
--- linux-2.6.16-rc5-git11.orig/mm/mempolicy.c 2006-03-09 16:19:57.000000000 -0500
+++ linux-2.6.16-rc5-git11/mm/mempolicy.c 2006-03-09 16:46:49.000000000 -0500
@@ -187,6 +187,37 @@ static ssize_t sched_migrate_interval_st
}
MIGRATION_ATTR_RW(sched_migrate_interval);
+/*
+ * sched_migrate_lazy: use "lazy migration"--i.e., migration-on-fault--
+ * for scheduler driven task memory migration.
+ */
+int sched_migrate_lazy = 0;
+
+static int __init set_sched_migrate_lazy(char *str)
+{
+ get_option(&str, &sched_migrate_lazy);
+ return 1;
+}
+
+__setup("sched_migrate_lazy", set_sched_migrate_lazy);
+
+static ssize_t sched_migrate_lazy_show(struct subsystem *subsys, char *page)
+{
+ return sprintf(page, "sched_migrate_lazy %s\n",
+ sched_migrate_lazy ? "on" : "off");
+}
+static ssize_t sched_migrate_lazy_store(struct subsystem *subsys,
+ const char *page, size_t count)
+{
+ unsigned long n = simple_strtoul(page, NULL, 10);
+ if (n)
+ sched_migrate_lazy = 1;
+ else
+ sched_migrate_lazy = 0;
+ return count;
+}
+MIGRATION_ATTR_RW(sched_migrate_lazy);
+
decl_subsys(migration, NULL, NULL);
EXPORT_SYMBOL(migration_subsys);
@@ -194,6 +225,7 @@ EXPORT_SYMBOL(migration_subsys);
static struct attribute *migration_attrs[] = {
&sched_migrate_memory_attr.attr,
&sched_migrate_interval_attr.attr,
+ &sched_migrate_lazy_attr.attr,
NULL
};
@@ -882,8 +914,12 @@ static int migrate_vma_to_node(struct vm
if (IS_ERR(vma))
err = PTR_ERR(vma);
- else if (!list_empty(&pagelist))
- err = migrate_pages_to(&pagelist, NULL, dest);
+ else if (!list_empty(&pagelist)) {
+ if (!sched_migrate_lazy)
+ err = migrate_pages_to(&pagelist, NULL, dest);
+ else
+ err = migrate_pages_unmap_only(&pagelist);
+ }
if (!list_empty(&pagelist))
putback_lru_pages(&pagelist);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2006-03-10 19:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1142020770.5204.34.camel@localhost.localdomain \
--to=lee.schermerhorn@hp.com \
--cc=linux-mm@kvack.org \
/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