From: Ray Bryant <raybry@sgi.com>
To: Hirokazu Takahashi <taka@valinux.co.jp>,
marcelo.tosatti@cyclades.com, haveblue@us.ibm.com
Cc: linux-mm@kvack.org
Subject: Re: page migration
Date: Tue, 04 Jan 2005 18:08:48 -0600 [thread overview]
Message-ID: <41DB3010.7000600@sgi.com> (raw)
In-Reply-To: <41DAD393.1030009@sgi.com>
[-- Attachment #1: Type: text/plain, Size: 885 bytes --]
The attached patch changes "migrate_onepage(page)" to
"migrate_onepage(page, nodeid)". For the case where
the caller doesn't care which target node is used,
then the call: "migrate_onepage(page, MIGRATE_NODE_ANY)"
causes migrate_onepage() to revert to its previous
behavior.
Since migrate_onepage() is only called in mmigrate.c
at the present time, this is a localized change.
This patch applies at the end of the migration
patches.
Unless there are objections, I'd like Dave to add this
patch to the hotplug patch as part of the page migration
patchset.
--
Best Regards,
Ray
-----------------------------------------------
Ray Bryant
512-453-9679 (work) 512-507-7807 (cell)
raybry@sgi.com raybry@austin.rr.com
The box said: "Requires Windows 98 or better",
so I installed Linux.
-----------------------------------------------
[-- Attachment #2: add-node-arg-to-migrate_onepage.patch --]
[-- Type: text/plain, Size: 2908 bytes --]
Index: linux-2.6.10-rc2-mm4-page-migration-only/include/linux/mmigrate.h
===================================================================
--- linux-2.6.10-rc2-mm4-page-migration-only.orig/include/linux/mmigrate.h 2004-12-23 17:04:41.000000000 -0800
+++ linux-2.6.10-rc2-mm4-page-migration-only/include/linux/mmigrate.h 2005-01-04 07:23:36.000000000 -0800
@@ -4,6 +4,7 @@
#include <linux/config.h>
#include <linux/mm.h>
+#define MIGRATE_NODE_ANY -1
#ifdef CONFIG_MEMORY_MIGRATE
extern int generic_migrate_page(struct page *, struct page *,
@@ -14,7 +15,7 @@ extern int migrate_page_buffer(struct pa
struct list_head *);
extern int page_migratable(struct page *, struct page *, int,
struct list_head *);
-extern struct page * migrate_onepage(struct page *);
+extern struct page * migrate_onepage(struct page *, int nodeid);
extern int try_to_migrate_pages(struct list_head *);
#else
Index: linux-2.6.10-rc2-mm4-page-migration-only/mm/mmigrate.c
===================================================================
--- linux-2.6.10-rc2-mm4-page-migration-only.orig/mm/mmigrate.c 2005-01-04 07:09:24.000000000 -0800
+++ linux-2.6.10-rc2-mm4-page-migration-only/mm/mmigrate.c 2005-01-04 07:30:57.000000000 -0800
@@ -404,7 +404,7 @@ out_removing:
* swapcache or anonymous memory.
*/
struct page *
-migrate_onepage(struct page *page)
+migrate_onepage(struct page *page, int nodeid)
{
struct page *newpage;
struct address_space *mapping;
@@ -434,7 +434,10 @@ migrate_onepage(struct page *page)
* Allocate a new page with the same gfp_mask
* as the target page has.
*/
- newpage = page_cache_alloc(mapping, page->index);
+ if (nodeid == MIGRATE_NODE_ANY)
+ newpage = page_cache_alloc(mapping, page->index);
+ else
+ newpage = alloc_pages_node(nodeid, mapping->flags, 0);
if (newpage == NULL) {
unlock_page(page);
return ERR_PTR(-ENOMEM);
@@ -538,7 +541,7 @@ int try_to_migrate_pages(struct list_hea
list_for_each_entry_safe(page, page2, &pass1_list, lru) {
list_del(&page->lru);
if (PageLocked(page) || PageWriteback(page) ||
- IS_ERR(newpage = migrate_onepage(page))) {
+ IS_ERR(newpage = migrate_onepage(page, MIGRATE_NODE_ANY))) {
if (page_count(page) == 1) {
/* the page is already unused */
putback_page_to_lru(page_zone(page), page);
@@ -556,7 +559,7 @@ int try_to_migrate_pages(struct list_hea
*/
list_for_each_entry_safe(page, page2, &pass2_list, lru) {
list_del(&page->lru);
- if (IS_ERR(newpage = migrate_onepage(page))) {
+ if (IS_ERR(newpage = migrate_onepage(page, MIGRATE_NODE_ANY))) {
if (page_count(page) == 1) {
/* the page is already unused */
putback_page_to_lru(page_zone(page), page);
@@ -586,4 +589,4 @@ EXPORT_SYMBOL(generic_migrate_page);
EXPORT_SYMBOL(migrate_page_common);
EXPORT_SYMBOL(migrate_page_buffer);
EXPORT_SYMBOL(page_migratable);
-
+EXPORT_SYMBOL(migrate_onepage);
next prev parent reply other threads:[~2005-01-05 0:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 17:48 Ray Bryant
2005-01-03 18:25 ` Dave Hansen
2005-01-03 19:04 ` Ray Bryant
2005-01-03 16:24 ` page migration\ Marcelo Tosatti
2005-01-03 17:13 ` Marcelo Tosatti
2005-01-03 20:33 ` Ray Bryant
2005-01-03 18:38 ` Marcelo Tosatti
2005-01-04 15:42 ` Hirokazu Takahashi
2005-01-04 17:34 ` Ray Bryant
2005-01-04 16:11 ` Marcelo Tosatti
2005-01-05 0:08 ` Ray Bryant [this message]
2005-01-03 20:30 ` page migration Ray Bryant
2005-01-03 19:37 ` Dave Hansen
2005-01-03 20:15 ` Ray Bryant
2005-01-03 20:17 ` William Lee Irwin III
2005-01-03 20:36 ` Ray Bryant
2005-01-04 14:42 ` Hirokazu Takahashi
2005-01-04 17:30 ` Ray Bryant
2005-01-04 17:40 ` process " Dave Hansen
2005-01-04 18:26 ` Ray Bryant
2005-01-07 16:40 ` page migration patch Ray Bryant
2005-01-10 2:58 ` Dave Hansen
2005-01-07 16:57 ` migration cache, updated Ray Bryant
2005-01-10 10:07 ` Marcelo Tosatti
2005-01-04 22:03 ` page migration Yasunori Goto
2005-01-04 23:58 ` Ray Bryant
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=41DB3010.7000600@sgi.com \
--to=raybry@sgi.com \
--cc=haveblue@us.ibm.com \
--cc=linux-mm@kvack.org \
--cc=marcelo.tosatti@cyclades.com \
--cc=taka@valinux.co.jp \
/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