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