aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 6b0c37dcfd1..6bc039486e9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2628,6 +2628,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
2628 swp_entry_t entry; 2628 swp_entry_t entry;
2629 pte_t pte; 2629 pte_t pte;
2630 struct mem_cgroup *ptr = NULL; 2630 struct mem_cgroup *ptr = NULL;
2631 int exclusive = 0;
2631 int ret = 0; 2632 int ret = 0;
2632 2633
2633 if (!pte_unmap_same(mm, pmd, page_table, orig_pte)) 2634 if (!pte_unmap_same(mm, pmd, page_table, orig_pte))
@@ -2722,10 +2723,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
2722 if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) { 2723 if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) {
2723 pte = maybe_mkwrite(pte_mkdirty(pte), vma); 2724 pte = maybe_mkwrite(pte_mkdirty(pte), vma);
2724 flags &= ~FAULT_FLAG_WRITE; 2725 flags &= ~FAULT_FLAG_WRITE;
2726 exclusive = 1;
2725 } 2727 }
2726 flush_icache_page(vma, page); 2728 flush_icache_page(vma, page);
2727 set_pte_at(mm, address, page_table, pte); 2729 set_pte_at(mm, address, page_table, pte);
2728 page_add_anon_rmap(page, vma, address); 2730 do_page_add_anon_rmap(page, vma, address, exclusive);
2729 /* It's better to call commit-charge after rmap is established */ 2731 /* It's better to call commit-charge after rmap is established */
2730 mem_cgroup_commit_charge_swapin(page, ptr); 2732 mem_cgroup_commit_charge_swapin(page, ptr);
2731 2733