memcg: page_cache_release not __free_page
authorHugh Dickins <[email protected]>
Tue, 4 Mar 2008 22:29:04 +0000 (14:29 -0800)
committerLinus Torvalds <[email protected]>
Wed, 5 Mar 2008 00:35:14 +0000 (16:35 -0800)
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 <[email protected]>
Cc: David Rientjes <[email protected]>
Acked-by: Balbir Singh <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Cc: Hirokazu Takahashi <[email protected]>
Cc: YAMAMOTO Takashi <[email protected]>
Cc: Paul Menage <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memory.c

index ce3c9e4492d803b011f50ea8641e477056116ddd..7f8c03ec587c1db05ef83384282c89dc54e93cb3 100644 (file)
@@ -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;
 }