Index: linux-2.6.17-rc1-mm2/mm/migrate.c =================================================================== --- linux-2.6.17-rc1-mm2.orig/mm/migrate.c 2006-04-17 17:21:08.000000000 -0700 +++ linux-2.6.17-rc1-mm2/mm/migrate.c 2006-04-17 23:53:32.000000000 -0700 @@ -217,9 +217,6 @@ out: /* * Get rid of all migration entries and replace them by * references to the indicated page. - * - * Must hold mmap_sem lock on at least one of the vmas containing - * the page so that the anon_vma cannot vanish. */ static void remove_migration_ptes(struct page *old, struct page *new) { @@ -236,7 +233,6 @@ static void remove_migration_ptes(struct * We hold the mmap_sem lock. So no need to call page_lock_anon_vma. */ anon_vma = (struct anon_vma *) (mapping - PAGE_MAPPING_ANON); - spin_lock(&anon_vma->lock); list_for_each_entry(vma, &anon_vma->head, anon_vma_node) remove_migration_pte(vma, page_address_in_vma(new, vma), @@ -464,7 +460,7 @@ redo: /* page was freed from under us. So we are done. */ goto next; - if (to && list_empty(to)) + if (list_empty(to)) break; /* Index: linux-2.6.17-rc1-mm2/mm/rmap.c =================================================================== --- linux-2.6.17-rc1-mm2.orig/mm/rmap.c 2006-04-17 17:21:08.000000000 -0700 +++ linux-2.6.17-rc1-mm2/mm/rmap.c 2006-04-17 23:53:39.000000000 -0700 @@ -723,7 +723,8 @@ static int try_to_unmap_anon(struct page if (ret == SWAP_FAIL || !page_mapped(page)) break; } - spin_unlock(&anon_vma->lock); + if (!migration) + spin_unlock(&anon_vma->lock); return ret; }