linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Christoph Lameter <clameter@sgi.com>, linux-mm@kvack.org
Subject: Re: page migration: Fail with error if swap not setup
Date: Tue, 14 Mar 2006 19:53:22 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0603141949290.24395@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20060314192443.0d121e73.akpm@osdl.org>

On Tue, 14 Mar 2006, Andrew Morton wrote:

> >  		lru_add_drain_all();
> > +	}
> >  
> 
> Whereas this appears to be racy...

Migration just makes the best effort. Page that are moved off the LRU 
after the draining end up on the failed migration list and will not be 
migrated.

Sorry about the blank. New patch with more explanations?



page migration: Fail with error if swap not setup

Currently the migration of anonymous pages will silently fail if no
swap is setup. This patch makes page migration functions to check
for available swap and fail with -ENODEV if no swap space is available.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.16-rc6/mm/mempolicy.c
===================================================================
--- linux-2.6.16-rc6.orig/mm/mempolicy.c	2006-03-14 16:31:15.000000000 -0800
+++ linux-2.6.16-rc6/mm/mempolicy.c	2006-03-14 19:52:25.000000000 -0800
@@ -330,9 +330,19 @@ check_range(struct mm_struct *mm, unsign
 	int err;
 	struct vm_area_struct *first, *vma, *prev;
 
-	/* Clear the LRU lists so pages can be isolated */
-	if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
+	if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
+		/* Must have swap device for migration */
+		if (nr_swap_pages <= 0)
+			return ERR_PTR(-ENODEV);
+
+		/*
+		 * Clear the LRU lists so pages can be isolated.
+		 * Note that pages may be moved off the LRU after we have
+		 * drained them. Those pages will fail to migrate like other
+		 * pages that may be busy.
+		 */
 		lru_add_drain_all();
+	}
 
 	first = find_vma(mm, start);
 	if (!first)
 

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

  parent reply	other threads:[~2006-03-15  3:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-15  3:05 Christoph Lameter
2006-03-15  3:24 ` Andrew Morton
2006-03-15  3:49   ` Christoph Lameter
2006-03-15  3:52     ` Andrew Morton
2006-03-15  3:59       ` Christoph Lameter
2006-03-15 12:49         ` Nick Piggin
2006-03-15 16:35           ` Christoph Lameter
2006-03-15  3:53   ` Christoph Lameter [this message]
2006-03-15 14:47 ` Lee Schermerhorn
2006-03-15 17:11   ` Christoph Lameter
2006-03-15 20:47     ` Marcelo Tosatti
2006-03-15 18:08       ` Christoph Lameter
2006-03-15 21:39         ` Marcelo Tosatti
2006-03-15 19:00           ` Christoph Lameter
2006-03-15 23:06             ` Marcelo Tosatti

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.0603141949290.24395@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@osdl.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