diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2012-07-31 19:45:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 21:42:48 -0400 |
commit | 5d84c7766e8aacc6e3477bdf02fdb417163cf89b (patch) | |
tree | c0cfc049f0b47713f30e36a56f6dd85b9f4363a5 /mm/swapfile.c | |
parent | 0030f535a5cf9b1841d2088c10a0b2f8f2987460 (diff) |
mm: swapfile: clean up unuse_pte race handling
The conditional mem_cgroup_cancel_charge_swapin() is a leftover from when
the function would continue to reestablish the page even after
mem_cgroup_try_charge_swapin() failed. After 85d9fc8 "memcg: fix refcnt
handling at swapoff", the condition is always true when this code is
reached.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Wanpeng Li <liwp.linux@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 63958d60ecb0..14e254c768fc 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -835,8 +835,7 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd, | |||
835 | 835 | ||
836 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); | 836 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); |
837 | if (unlikely(!pte_same(*pte, swp_entry_to_pte(entry)))) { | 837 | if (unlikely(!pte_same(*pte, swp_entry_to_pte(entry)))) { |
838 | if (ret > 0) | 838 | mem_cgroup_cancel_charge_swapin(memcg); |
839 | mem_cgroup_cancel_charge_swapin(memcg); | ||
840 | ret = 0; | 839 | ret = 0; |
841 | goto out; | 840 | goto out; |
842 | } | 841 | } |