From: Mel Gorman <mel@csn.ul.ie>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Mel Gorman <mel@csn.ul.ie>,
kamezawa.hiroyu@jp.fujitsu.com, clameter@sgi.com
Subject: [PATCH 3/7] Allow CONFIG_MIGRATION to be set without CONFIG_NUMA
Date: Tue, 29 May 2007 18:37:10 +0100 (IST) [thread overview]
Message-ID: <20070529173710.1570.91203.sendpatchset@skynet.skynet.ie> (raw)
In-Reply-To: <20070529173609.1570.4686.sendpatchset@skynet.skynet.ie>
CONFIG_MIGRATION currently depends on CONFIG_NUMA. move_pages() is the only
user of migration today and as this system call is only meaningful on NUMA,
it makes sense. However, memory compaction will operate within a zone and is
useful on both NUMA and non-NUMA systems. This patch allows CONFIG_MIGRATION
to be used in all memory models. To preserve existing behaviour, move_pages()
is only available when CONFIG_NUMA is set.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@shadowen.org>
---
include/linux/migrate.h | 11 ++++++++---
include/linux/mm.h | 2 ++
mm/Kconfig | 5 ++++-
mm/migrate.c | 4 ++--
4 files changed, 16 insertions(+), 6 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc2-mm1-005_migrate_nocontext/include/linux/migrate.h linux-2.6.22-rc2-mm1-015_migration_flatmem/include/linux/migrate.h
--- linux-2.6.22-rc2-mm1-005_migrate_nocontext/include/linux/migrate.h 2007-05-28 14:11:32.000000000 +0100
+++ linux-2.6.22-rc2-mm1-015_migration_flatmem/include/linux/migrate.h 2007-05-29 10:00:09.000000000 +0100
@@ -7,7 +7,7 @@
typedef struct page *new_page_t(struct page *, unsigned long private, int **);
-#ifdef CONFIG_MIGRATION
+#ifdef CONFIG_SYSCALL_MOVE_PAGES
/* Check if a vma is migratable */
static inline int vma_migratable(struct vm_area_struct *vma)
{
@@ -24,7 +24,14 @@ static inline int vma_migratable(struct
return 0;
return 1;
}
+#else
+static inline int vma_migratable(struct vm_area_struct *vma)
+{
+ return 0;
+}
+#endif
+#ifdef CONFIG_MIGRATION
extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
extern int putback_lru_pages(struct list_head *l);
extern int migrate_page(struct address_space *,
@@ -40,8 +47,6 @@ extern int migrate_vmas(struct mm_struct
const nodemask_t *from, const nodemask_t *to,
unsigned long flags);
#else
-static inline int vma_migratable(struct vm_area_struct *vma)
- { return 0; }
static inline int isolate_lru_page(struct page *p, struct list_head *list)
{ return -ENOSYS; }
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc2-mm1-005_migrate_nocontext/include/linux/mm.h linux-2.6.22-rc2-mm1-015_migration_flatmem/include/linux/mm.h
--- linux-2.6.22-rc2-mm1-005_migrate_nocontext/include/linux/mm.h 2007-05-24 10:13:34.000000000 +0100
+++ linux-2.6.22-rc2-mm1-015_migration_flatmem/include/linux/mm.h 2007-05-28 14:13:44.000000000 +0100
@@ -242,6 +242,8 @@ struct vm_operations_struct {
int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
unsigned long addr);
+#endif /* CONFIG_NUMA */
+#ifdef CONFIG_MIGRATION
int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
const nodemask_t *to, unsigned long flags);
#endif
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc2-mm1-005_migrate_nocontext/mm/Kconfig linux-2.6.22-rc2-mm1-015_migration_flatmem/mm/Kconfig
--- linux-2.6.22-rc2-mm1-005_migrate_nocontext/mm/Kconfig 2007-05-24 10:13:34.000000000 +0100
+++ linux-2.6.22-rc2-mm1-015_migration_flatmem/mm/Kconfig 2007-05-29 09:57:23.000000000 +0100
@@ -145,13 +145,16 @@ config SPLIT_PTLOCK_CPUS
config MIGRATION
bool "Page migration"
def_bool y
- depends on NUMA
help
Allows the migration of the physical location of pages of processes
while the virtual addresses are not changed. This is useful for
example on NUMA systems to put pages nearer to the processors accessing
the page.
+config SYSCALL_MOVE_PAGES
+ def_bool y
+ depends on MIGRATION && NUMA
+
config RESOURCES_64BIT
bool "64 bit Memory and IO resources (EXPERIMENTAL)" if (!64BIT && EXPERIMENTAL)
default 64BIT
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.22-rc2-mm1-005_migrate_nocontext/mm/migrate.c linux-2.6.22-rc2-mm1-015_migration_flatmem/mm/migrate.c
--- linux-2.6.22-rc2-mm1-005_migrate_nocontext/mm/migrate.c 2007-05-28 14:11:32.000000000 +0100
+++ linux-2.6.22-rc2-mm1-015_migration_flatmem/mm/migrate.c 2007-05-29 10:01:40.000000000 +0100
@@ -761,7 +761,7 @@ int migrate_pages_nocontext(struct list_
return __migrate_pages(from, get_new_page, private, 1);
}
-#ifdef CONFIG_NUMA
+#ifdef CONFIG_SYSCALL_MOVE_PAGES
/*
* Move a list of individual pages
*/
@@ -1018,7 +1018,7 @@ out2:
mmput(mm);
return err;
}
-#endif
+#endif /* CONFIG_SYSCALL_MOVE_PAGES */
/*
* Call migration functions in the vma_ops that may prepare
next prev parent reply other threads:[~2007-05-29 17:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-29 17:36 [PATCH 0/7] [RFC] Memory Compaction v1 Mel Gorman
2007-05-29 17:36 ` [PATCH 1/7] Roll-up patch of what has been sent already Mel Gorman
2007-05-29 17:36 ` [PATCH 2/7] KAMEZAWA Hiroyuki - migration by kernel Mel Gorman
2007-05-30 2:42 ` KAMEZAWA Hiroyuki
2007-05-30 2:47 ` Christoph Lameter
2007-05-30 19:57 ` Hugh Dickins
2007-05-30 20:07 ` Christoph Lameter
2007-05-30 20:10 ` Christoph Lameter
2007-05-31 12:26 ` KAMEZAWA Hiroyuki
2007-05-29 17:37 ` Mel Gorman [this message]
2007-05-29 18:01 ` [PATCH 3/7] Allow CONFIG_MIGRATION to be set without CONFIG_NUMA Christoph Lameter
2007-05-29 18:21 ` Mel Gorman
2007-05-29 18:36 ` Christoph Lameter
2007-05-29 18:49 ` Mel Gorman
2007-05-29 17:37 ` [PATCH 4/7] Introduce isolate_lru_page_nolock() as a lockless version of isolate_lru_page() Mel Gorman
2007-05-29 17:37 ` [PATCH 5/7] Provide metrics on the extent of fragmentation in zones Mel Gorman
2007-05-29 17:38 ` [PATCH 6/7] Introduce a means of compacting memory within a zone Mel Gorman
2007-05-29 17:38 ` [PATCH 7/7] Add /proc/sys/vm/compact_node for the explicit compaction of a node Mel Gorman
2007-05-30 4:14 ` Christoph Lameter
2007-05-30 8:26 ` Mel Gorman
2007-05-30 17:33 ` Christoph Lameter
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=20070529173710.1570.91203.sendpatchset@skynet.skynet.ie \
--to=mel@csn.ul.ie \
--cc=clameter@sgi.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®