Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19376
b: refs/heads/master
c: b16664e
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 1, 2006
1 parent 83f0e33 commit 81b768f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a16e3f4b0c408b9e50297d2ec27e295d490267a
refs/heads/master: b16664e44c54525be89dc07ad15a13b4eeec5634
7 changes: 7 additions & 0 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,7 @@ 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 @@ -1894,6 +1895,12 @@ 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
8 changes: 8 additions & 0 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,14 @@ static int shmem_getpage(struct inode *inode, unsigned long idx,
page_cache_release(swappage);
goto repeat;
}
if (!PageSwapCache(swappage)) {
/* Page migration has occured */
shmem_swp_unmap(entry);
spin_unlock(&info->lock);
unlock_page(swappage);
page_cache_release(swappage);
goto repeat;
}
if (PageWriteback(swappage)) {
shmem_swp_unmap(entry);
spin_unlock(&info->lock);
Expand Down
7 changes: 7 additions & 0 deletions trunk/mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ static int try_to_unuse(unsigned int type)
*/
swap_map = &si->swap_map[i];
entry = swp_entry(type, i);
again:
page = read_swap_cache_async(entry, NULL, 0);
if (!page) {
/*
Expand Down Expand Up @@ -680,6 +681,12 @@ static int try_to_unuse(unsigned int type)
wait_on_page_locked(page);
wait_on_page_writeback(page);
lock_page(page);
if (!PageSwapCache(page)) {
/* Page migration has occured */
unlock_page(page);
page_cache_release(page);
goto again;
}
wait_on_page_writeback(page);

/*
Expand Down

0 comments on commit 81b768f

Please sign in to comment.