linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] Page Cache Policy V0.0 1/5 add offset arg to migrate_pages_to()
@ 2006-04-20 20:41 Lee Schermerhorn
  2006-04-20 23:54 ` Christoph Lameter
  0 siblings, 1 reply; 2+ messages in thread
From: Lee Schermerhorn @ 2006-04-20 20:41 UTC (permalink / raw)
  To: linux-mm; +Cc: Christoph Lameter, Andi Kleen, Eric Whitney

Page Cache Policy V0.0 1/5 add offset arg to migrate_pages_to()

This patch adds a page offset arg to migrate_pages_to() for
use in selecting nodes from which to allocate for regions with
interleave policy.   This is needed to calculate the correct
node for shmem and generic mmap()ed files using the shared
policy infrastructure [subsequent patches]

Signed-off-by:  Lee Schermerhorn <lee.schermerhorn@hp.com>

Index: linux-2.6.17-rc1-mm2/include/linux/migrate.h
===================================================================
--- linux-2.6.17-rc1-mm2.orig/include/linux/migrate.h	2006-04-20 12:04:21.000000000 -0400
+++ linux-2.6.17-rc1-mm2/include/linux/migrate.h	2006-04-20 12:04:51.000000000 -0400
@@ -12,8 +12,8 @@ extern void migrate_page_copy(struct pag
 extern int migrate_page_remove_references(struct page *, struct page *, int);
 extern int migrate_pages(struct list_head *l, struct list_head *t,
 		struct list_head *moved, struct list_head *failed);
-extern int migrate_pages_to(struct list_head *pagelist,
-			struct vm_area_struct *vma, int dest);
+extern int migrate_pages_to(struct list_head *, struct vm_area_struct *,
+		int, unsigned long);
 extern int fail_migrate_page(struct page *, struct page *);
 
 extern int migrate_prep(void);
Index: linux-2.6.17-rc1-mm2/mm/mempolicy.c
===================================================================
--- linux-2.6.17-rc1-mm2.orig/mm/mempolicy.c	2006-04-20 12:04:21.000000000 -0400
+++ linux-2.6.17-rc1-mm2/mm/mempolicy.c	2006-04-20 12:05:35.000000000 -0400
@@ -604,7 +604,7 @@ int migrate_to_node(struct mm_struct *mm
 			flags | MPOL_MF_DISCONTIG_OK, &pagelist);
 
 	if (!list_empty(&pagelist)) {
-		err = migrate_pages_to(&pagelist, NULL, dest);
+		err = migrate_pages_to(&pagelist, NULL, dest, 0L);
 		if (!list_empty(&pagelist))
 			putback_lru_pages(&pagelist);
 	}
@@ -767,7 +767,8 @@ long do_mbind(unsigned long start, unsig
 		err = mbind_range(vma, start, end, new);
 
 		if (!list_empty(&pagelist))
-			nr_failed = migrate_pages_to(&pagelist, vma, -1);
+			nr_failed = migrate_pages_to(&pagelist, vma, -1,
+					start - vma->vm_start);
 
 		if (!err && nr_failed && (flags & MPOL_MF_STRICT))
 			err = -EIO;
Index: linux-2.6.17-rc1-mm2/mm/migrate.c
===================================================================
--- linux-2.6.17-rc1-mm2.orig/mm/migrate.c	2006-04-20 12:04:21.000000000 -0400
+++ linux-2.6.17-rc1-mm2/mm/migrate.c	2006-04-20 12:04:51.000000000 -0400
@@ -584,14 +584,13 @@ EXPORT_SYMBOL(buffer_migrate_page);
  * Specify destination with either non-NULL vma or dest_node >= 0
  * Return the number of pages not migrated or error code
  */
-int migrate_pages_to(struct list_head *pagelist,
-			struct vm_area_struct *vma, int dest)
+int migrate_pages_to(struct list_head *pagelist, struct vm_area_struct *vma,
+			int dest, unsigned long offset)
 {
 	LIST_HEAD(newlist);
 	LIST_HEAD(moved);
 	LIST_HEAD(failed);
 	int err = 0;
-	unsigned long offset = 0;
 	int nr_pages;
 	struct page *page;
 	struct list_head *p;


--
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH/RFC] Page Cache Policy V0.0 1/5 add offset arg to migrate_pages_to()
  2006-04-20 20:41 [PATCH/RFC] Page Cache Policy V0.0 1/5 add offset arg to migrate_pages_to() Lee Schermerhorn
@ 2006-04-20 23:54 ` Christoph Lameter
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Lameter @ 2006-04-20 23:54 UTC (permalink / raw)
  To: Lee Schermerhorn; +Cc: linux-mm, Andi Kleen, Eric Whitney

On Thu, 20 Apr 2006, Lee Schermerhorn wrote:

> Page Cache Policy V0.0 1/5 add offset arg to migrate_pages_to()
> 
> This patch adds a page offset arg to migrate_pages_to() for
> use in selecting nodes from which to allocate for regions with
> interleave policy.   This is needed to calculate the correct
> node for shmem and generic mmap()ed files using the shared
> policy infrastructure [subsequent patches]

Why do we not need this patch? Is it not possible to
calculate the interleave node from the inode offset? This is only 
necessary for the case in which no vma is available right?

--
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-20 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-20 20:41 [PATCH/RFC] Page Cache Policy V0.0 1/5 add offset arg to migrate_pages_to() Lee Schermerhorn
2006-04-20 23:54 ` Christoph Lameter

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).