From: Christoph Lameter <clameter@sgi.com>
To: akpm@osdl.org
Cc: linux-mm@kvack.org
Subject: Page Migration: Make do_swap_page redo the fault
Date: Mon, 3 Apr 2006 22:33:49 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0604032228150.24182@schroedinger.engr.sgi.com> (raw)
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>
next reply other threads:[~2006-04-04 5:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-04 5:33 Christoph Lameter [this message]
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
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.0604032228150.24182@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