Skip to content

Commit

Permalink
memcg: page_cache_release not __free_page
Browse files Browse the repository at this point in the history
There's nothing wrong with mem_cgroup_charge failure in do_wp_page and
do_anonymous page using __free_page, but it does look odd when nearby code
uses page_cache_release: use that instead (while turning a blind eye to
ancient inconsistencies of page_cache_release versus put_page).

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Rientjes <rientjes@google.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Mar 5, 2008
1 parent 427d541 commit 6dbf6d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
}
return ret;
oom_free_new:
__free_page(new_page);
page_cache_release(new_page);
oom:
if (old_page)
page_cache_release(old_page);
Expand Down Expand Up @@ -2163,7 +2163,7 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
page_cache_release(page);
goto unlock;
oom_free_page:
__free_page(page);
page_cache_release(page);
oom:
return VM_FAULT_OOM;
}
Expand Down

0 comments on commit 6dbf6d3

Please sign in to comment.