aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 1c0a3db78a05..da91b7bf9986 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1686,10 +1686,6 @@ static int do_swap_page(struct mm_struct * mm,
1686 } 1686 }
1687 1687
1688 /* The page isn't present yet, go ahead with the fault. */ 1688 /* The page isn't present yet, go ahead with the fault. */
1689
1690 swap_free(entry);
1691 if (vm_swap_full())
1692 remove_exclusive_swap_page(page);
1693 1689
1694 inc_mm_counter(mm, rss); 1690 inc_mm_counter(mm, rss);
1695 pte = mk_pte(page, vma->vm_page_prot); 1691 pte = mk_pte(page, vma->vm_page_prot);
@@ -1697,12 +1693,16 @@ static int do_swap_page(struct mm_struct * mm,
1697 pte = maybe_mkwrite(pte_mkdirty(pte), vma); 1693 pte = maybe_mkwrite(pte_mkdirty(pte), vma);
1698 write_access = 0; 1694 write_access = 0;
1699 } 1695 }
1700 unlock_page(page);
1701 1696
1702 flush_icache_page(vma, page); 1697 flush_icache_page(vma, page);
1703 set_pte_at(mm, address, page_table, pte); 1698 set_pte_at(mm, address, page_table, pte);
1704 page_add_anon_rmap(page, vma, address); 1699 page_add_anon_rmap(page, vma, address);
1705 1700
1701 swap_free(entry);
1702 if (vm_swap_full())
1703 remove_exclusive_swap_page(page);
1704 unlock_page(page);
1705
1706 if (write_access) { 1706 if (write_access) {
1707 if (do_wp_page(mm, vma, address, 1707 if (do_wp_page(mm, vma, address,
1708 page_table, pmd, pte) == VM_FAULT_OOM) 1708 page_table, pmd, pte) == VM_FAULT_OOM)