Skip to content

Commit

Permalink
[PATCH] Page Migration: Make do_swap_page redo the fault
Browse files Browse the repository at this point in the history
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>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jun 23, 2006
1 parent cb2b95e commit 4da5eda
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,6 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
goto out;

entry = pte_to_swp_entry(orig_pte);
again:
page = lookup_swap_cache(entry);
if (!page) {
swapin_readahead(entry, address, vma);
Expand All @@ -1903,12 +1902,6 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,

mark_page_accessed(page);
lock_page(page);
if (!PageSwapCache(page)) {
/* Page migration has occured */
unlock_page(page);
page_cache_release(page);
goto again;
}

/*
* Back out if somebody else already faulted in this pte.
Expand Down

0 comments on commit 4da5eda

Please sign in to comment.