linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Page Migration: Make do_swap_page redo the fault
@ 2006-04-04  5:33 Christoph Lameter
  2006-04-08 12:16 ` Hugh Dickins
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Lameter @ 2006-04-04  5:33 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm

It is better to redo the complete fault if do_swap_page() finds
that the page is not in PageSwapCache() because the page migration
code may have replaced the swap pte already with a pte pointing
to valid memory.

do_swap_page may interpret an invalid swap entry without this patch 
because we do not reload the pte if we are looping back. The page 
migration code may already have reused the swap entry referenced by our
local swp_entry.

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

Index: linux-2.6.17-rc1/mm/memory.c
===================================================================
--- linux-2.6.17-rc1.orig/mm/memory.c	2006-04-02 20:22:10.000000000 -0700
+++ linux-2.6.17-rc1/mm/memory.c	2006-04-03 22:22:56.000000000 -0700
@@ -1879,7 +1879,6 @@ static int do_swap_page(struct mm_struct
 		goto out;
 
 	entry = pte_to_swp_entry(orig_pte);
-again:
 	page = lookup_swap_cache(entry);
 	if (!page) {
  		swapin_readahead(entry, address, vma);
@@ -1907,7 +1906,7 @@ again:
 		/* Page migration has occured */
 		unlock_page(page);
 		page_cache_release(page);
-		goto again;
+		goto out;
 	}
 
 	/*

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-04-11 15:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-04  5:33 Page Migration: Make do_swap_page redo the fault Christoph Lameter
2006-04-08 12:16 ` Hugh Dickins
2006-04-08 18:25   ` Christoph Lameter
2006-04-08 19:26     ` Hugh Dickins
2006-04-08 21:39       ` Christoph Lameter
2006-04-09  3:11         ` Hugh Dickins
2006-04-10 18:54           ` Hugh Dickins
2006-04-10 20:19             ` Christoph Lameter
2006-04-11 14:58               ` Lee Schermerhorn
2006-04-11 15:55                 ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox