linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@linux-foundation.org
Cc: Hugh Dickins <hugh@veritas.com>, linux-mm@kvack.org
Subject: page migration: Only migrate pages if allocation in the highest zone is possible
Date: Sun, 29 Apr 2007 23:17:23 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0704292316040.3036@schroedinger.engr.sgi.com> (raw)

Address spaces contain an allocation flag that specifies restriction on
the zone for pages placed in the mapping. I.e. some device may require pages
to be allocated from a DMA zone. Block devices may not be able to use pages
from HIGHMEM.

Memory policies and the common use of page migration works only on the
highest zone. If the address space does not allow allocation from the
highest zone then the pages in the address space are not migratable simply
because we can only allocate memory for a specified node if we allow
allocation for the highest zone on each node.

Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
 include/linux/migrate.h |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: linux-2.6.21-rc7-mm2/include/linux/migrate.h
===================================================================
--- linux-2.6.21-rc7-mm2.orig/include/linux/migrate.h	2007-04-15 16:50:57.000000000 -0700
+++ linux-2.6.21-rc7-mm2/include/linux/migrate.h	2007-04-27 23:14:49.000000000 -0700
@@ -2,6 +2,7 @@
 #define _LINUX_MIGRATE_H
 
 #include <linux/mm.h>
+#include <linux/mempolicy.h>
 
 typedef struct page *new_page_t(struct page *, unsigned long private, int **);
 
@@ -10,6 +11,14 @@ static inline int vma_migratable(struct 
 {
 	if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
 		return 0;
+	/*
+	 * Migration allocates pages in the highest zone. If we cannot
+	 * do so then migration (at least from node to node) is not
+	 * possible.
+	 */
+	if (vma->vm_file && vma->vm_file->f_mapping &&
+		gfp_zone(vma->vm_file->f_mapping->flags) < policy_zone)
+			return 0;
 	return 1;
 }
 

--
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:[~2007-04-30  6:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30  6:17 Christoph Lameter [this message]
2007-04-30 11:58 ` Hugh Dickins
2007-04-30 19:20   ` Christoph Lameter
2007-05-01 13:07     ` Hugh Dickins

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=Pine.LNX.4.64.0704292316040.3036@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.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