Re: [PATCH 14/14] mm,migration: Allow the migration of PageSwapCache pages

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mel Gorman
Date: Wednesday, April 7, 2010 - 9:49 am

On Tue, Apr 06, 2010 at 05:06:23PM -0700, Andrew Morton wrote:

This function existed before compaction and returns an error code rather
than a true/false value.


Patch below.


Patch that updates the comment if you prefer it is as follows

==== CUT HERE ====
mm,compaction: Expand comment on unmapped page swap cache

The comment on the handling of anon_vma for unmapped pages is a bit
sparse. Expand it.

This is a fix to the patch "mm,migration: Allow the migration of
PageSwapCache pages"

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 mm/migrate.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 0356e64..281a239 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -611,9 +611,15 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
 
 			/*
 			 * We cannot be sure that the anon_vma of an unmapped
-			 * swapcache page is safe to use. In this case, the
-			 * swapcache page gets migrated but the pages are not
-			 * remapped
+			 * swapcache page is safe to use because we don't
+			 * know in advance if the VMA that this page belonged
+			 * to still exists. If the VMA and others sharing the
+			 * data have been freed, then the anon_vma could
+			 * already be invalid.
+			 *
+			 * To avoid this possibility, swapcache pages get
+			 * migrated but are not remapped when migration
+			 * completes
 			 */
 			remap_swapcache = 0;
 		} else { 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/14] Memory Compaction v7, Mel Gorman, (Fri Apr 2, 9:02 am)
[PATCH 08/14] Memory compaction core, Mel Gorman, (Fri Apr 2, 9:02 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ..., KAMEZAWA Hiroyuki, (Mon Apr 5, 11:54 pm)
[No subject], Tarkan Erimer, (Tue Apr 6, 7:47 am)
[No subject], Mel Gorman, (Tue Apr 6, 8:00 am)
[No subject], Tarkan Erimer, (Tue Apr 6, 8:03 am)
[No subject], Minchan Kim, (Tue Apr 6, 8:37 am)
Re: [PATCH 08/14] Memory compaction core, Andrew Morton, (Tue Apr 6, 5:05 pm)
Re: [PATCH 08/14] Memory compaction core, Mel Gorman, (Wed Apr 7, 8:21 am)
Re: [PATCH 14/14] mm,migration: Allow the migration of Pag ..., Mel Gorman, (Wed Apr 7, 9:49 am)
Re: [PATCH 08/14] Memory compaction core, Mel Gorman, (Thu Apr 8, 9:59 am)
Re: [PATCH 08/14] Memory compaction core, Andrea Arcangeli, (Thu Apr 8, 10:06 am)