From: Hugh Dickins Date: Tue, 4 Mar 2008 22:29:04 +0000 (-0800) Subject: memcg: page_cache_release not __free_page X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6dbf6d3bb955d5a92005b6ecd6ffad2c5b95b963;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git memcg: page_cache_release not __free_page 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 Cc: David Rientjes Acked-by: Balbir Singh Acked-by: KAMEZAWA Hiroyuki Cc: Hirokazu Takahashi Cc: YAMAMOTO Takashi Cc: Paul Menage Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memory.c b/mm/memory.c index ce3c9e4492d8..7f8c03ec587c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1711,7 +1711,7 @@ unlock: } return ret; oom_free_new: - __free_page(new_page); + page_cache_release(new_page); oom: if (old_page) page_cache_release(old_page); @@ -2163,7 +2163,7 @@ release: page_cache_release(page); goto unlock; oom_free_page: - __free_page(page); + page_cache_release(page); oom: return VM_FAULT_OOM; }