diff options
author | Hugh Dickins <hugh@veritas.com> | 2008-03-04 17:29:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-04 19:35:15 -0500 |
commit | 8289546e573d5ff681cdf0fc7a1184cca66fdb55 (patch) | |
tree | 9cf874b55eb9a6c97233d137278c7b7c89a5f4a1 /include/linux/memcontrol.h | |
parent | 7e924aafa4b03ff71de34af8553d9a1ebc86c071 (diff) |
memcg: remove mem_cgroup_uncharge
Nothing uses mem_cgroup_uncharge apart from mem_cgroup_uncharge_page, (a
trivial wrapper around it) and mem_cgroup_end_migration (which does the same
as mem_cgroup_uncharge_page). And it often ends up having to lock just to let
its caller unlock. Remove it (but leave the silly locking until a later
patch).
Moved mem_cgroup_cache_charge next to mem_cgroup_charge in memcontrol.h.
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>
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 70789df7dab4..8b1c4295848b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -35,7 +35,8 @@ extern void mm_free_cgroup(struct mm_struct *mm); | |||
35 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); | 35 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); |
36 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | 36 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, |
37 | gfp_t gfp_mask); | 37 | gfp_t gfp_mask); |
38 | extern void mem_cgroup_uncharge(struct page_cgroup *pc); | 38 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
39 | gfp_t gfp_mask); | ||
39 | extern void mem_cgroup_uncharge_page(struct page *page); | 40 | extern void mem_cgroup_uncharge_page(struct page *page); |
40 | extern void mem_cgroup_move_lists(struct page *page, bool active); | 41 | extern void mem_cgroup_move_lists(struct page *page, bool active); |
41 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | 42 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, |
@@ -45,8 +46,6 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
45 | struct mem_cgroup *mem_cont, | 46 | struct mem_cgroup *mem_cont, |
46 | int active); | 47 | int active); |
47 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 48 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
48 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | ||
49 | gfp_t gfp_mask); | ||
50 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 49 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); |
51 | 50 | ||
52 | #define mm_match_cgroup(mm, cgroup) \ | 51 | #define mm_match_cgroup(mm, cgroup) \ |
@@ -92,14 +91,16 @@ static inline struct page_cgroup *page_get_page_cgroup(struct page *page) | |||
92 | return NULL; | 91 | return NULL; |
93 | } | 92 | } |
94 | 93 | ||
95 | static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | 94 | static inline int mem_cgroup_charge(struct page *page, |
96 | gfp_t gfp_mask) | 95 | struct mm_struct *mm, gfp_t gfp_mask) |
97 | { | 96 | { |
98 | return 0; | 97 | return 0; |
99 | } | 98 | } |
100 | 99 | ||
101 | static inline void mem_cgroup_uncharge(struct page_cgroup *pc) | 100 | static inline int mem_cgroup_cache_charge(struct page *page, |
101 | struct mm_struct *mm, gfp_t gfp_mask) | ||
102 | { | 102 | { |
103 | return 0; | ||
103 | } | 104 | } |
104 | 105 | ||
105 | static inline void mem_cgroup_uncharge_page(struct page *page) | 106 | static inline void mem_cgroup_uncharge_page(struct page *page) |
@@ -110,13 +111,6 @@ static inline void mem_cgroup_move_lists(struct page *page, bool active) | |||
110 | { | 111 | { |
111 | } | 112 | } |
112 | 113 | ||
113 | static inline int mem_cgroup_cache_charge(struct page *page, | ||
114 | struct mm_struct *mm, | ||
115 | gfp_t gfp_mask) | ||
116 | { | ||
117 | return 0; | ||
118 | } | ||
119 | |||
120 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 114 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) |
121 | { | 115 | { |
122 | return 1; | 116 | return 1; |