diff options
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 69 |
1 files changed, 19 insertions, 50 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index f94efd2f6c27..83e7ba90d6e5 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -63,12 +63,7 @@ extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | |||
63 | gfp_t gfp_mask); | 63 | gfp_t gfp_mask); |
64 | 64 | ||
65 | struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); | 65 | struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); |
66 | struct lruvec *mem_cgroup_lru_add_list(struct zone *, struct page *, | 66 | struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *); |
67 | enum lru_list); | ||
68 | void mem_cgroup_lru_del_list(struct page *, enum lru_list); | ||
69 | void mem_cgroup_lru_del(struct page *); | ||
70 | struct lruvec *mem_cgroup_lru_move_lists(struct zone *, struct page *, | ||
71 | enum lru_list, enum lru_list); | ||
72 | 67 | ||
73 | /* For coalescing uncharge for reducing memcg' overhead*/ | 68 | /* For coalescing uncharge for reducing memcg' overhead*/ |
74 | extern void mem_cgroup_uncharge_start(void); | 69 | extern void mem_cgroup_uncharge_start(void); |
@@ -79,6 +74,8 @@ extern void mem_cgroup_uncharge_cache_page(struct page *page); | |||
79 | 74 | ||
80 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, | 75 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, |
81 | int order); | 76 | int order); |
77 | bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg, | ||
78 | struct mem_cgroup *memcg); | ||
82 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); | 79 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); |
83 | 80 | ||
84 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 81 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
@@ -92,10 +89,13 @@ static inline | |||
92 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | 89 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
93 | { | 90 | { |
94 | struct mem_cgroup *memcg; | 91 | struct mem_cgroup *memcg; |
92 | int match; | ||
93 | |||
95 | rcu_read_lock(); | 94 | rcu_read_lock(); |
96 | memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner)); | 95 | memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner)); |
96 | match = __mem_cgroup_same_or_subtree(cgroup, memcg); | ||
97 | rcu_read_unlock(); | 97 | rcu_read_unlock(); |
98 | return cgroup == memcg; | 98 | return match; |
99 | } | 99 | } |
100 | 100 | ||
101 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); | 101 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); |
@@ -114,17 +114,11 @@ void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *); | |||
114 | /* | 114 | /* |
115 | * For memory reclaim. | 115 | * For memory reclaim. |
116 | */ | 116 | */ |
117 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, | 117 | int mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec); |
118 | struct zone *zone); | 118 | int mem_cgroup_inactive_file_is_low(struct lruvec *lruvec); |
119 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, | ||
120 | struct zone *zone); | ||
121 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); | 119 | int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); |
122 | unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, | 120 | unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list); |
123 | int nid, int zid, unsigned int lrumask); | 121 | void mem_cgroup_update_lru_size(struct lruvec *, enum lru_list, int); |
124 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, | ||
125 | struct zone *zone); | ||
126 | struct zone_reclaim_stat* | ||
127 | mem_cgroup_get_reclaim_stat_from_page(struct page *page); | ||
128 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, | 122 | extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, |
129 | struct task_struct *p); | 123 | struct task_struct *p); |
130 | extern void mem_cgroup_replace_page_cache(struct page *oldpage, | 124 | extern void mem_cgroup_replace_page_cache(struct page *oldpage, |
@@ -251,25 +245,8 @@ static inline struct lruvec *mem_cgroup_zone_lruvec(struct zone *zone, | |||
251 | return &zone->lruvec; | 245 | return &zone->lruvec; |
252 | } | 246 | } |
253 | 247 | ||
254 | static inline struct lruvec *mem_cgroup_lru_add_list(struct zone *zone, | 248 | static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page, |
255 | struct page *page, | 249 | struct zone *zone) |
256 | enum lru_list lru) | ||
257 | { | ||
258 | return &zone->lruvec; | ||
259 | } | ||
260 | |||
261 | static inline void mem_cgroup_lru_del_list(struct page *page, enum lru_list lru) | ||
262 | { | ||
263 | } | ||
264 | |||
265 | static inline void mem_cgroup_lru_del(struct page *page) | ||
266 | { | ||
267 | } | ||
268 | |||
269 | static inline struct lruvec *mem_cgroup_lru_move_lists(struct zone *zone, | ||
270 | struct page *page, | ||
271 | enum lru_list from, | ||
272 | enum lru_list to) | ||
273 | { | 250 | { |
274 | return &zone->lruvec; | 251 | return &zone->lruvec; |
275 | } | 252 | } |
@@ -333,35 +310,27 @@ static inline bool mem_cgroup_disabled(void) | |||
333 | } | 310 | } |
334 | 311 | ||
335 | static inline int | 312 | static inline int |
336 | mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) | 313 | mem_cgroup_inactive_anon_is_low(struct lruvec *lruvec) |
337 | { | 314 | { |
338 | return 1; | 315 | return 1; |
339 | } | 316 | } |
340 | 317 | ||
341 | static inline int | 318 | static inline int |
342 | mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, struct zone *zone) | 319 | mem_cgroup_inactive_file_is_low(struct lruvec *lruvec) |
343 | { | 320 | { |
344 | return 1; | 321 | return 1; |
345 | } | 322 | } |
346 | 323 | ||
347 | static inline unsigned long | 324 | static inline unsigned long |
348 | mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid, | 325 | mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru) |
349 | unsigned int lru_mask) | ||
350 | { | 326 | { |
351 | return 0; | 327 | return 0; |
352 | } | 328 | } |
353 | 329 | ||
354 | 330 | static inline void | |
355 | static inline struct zone_reclaim_stat* | 331 | mem_cgroup_update_lru_size(struct lruvec *lruvec, enum lru_list lru, |
356 | mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, struct zone *zone) | 332 | int increment) |
357 | { | ||
358 | return NULL; | ||
359 | } | ||
360 | |||
361 | static inline struct zone_reclaim_stat* | ||
362 | mem_cgroup_get_reclaim_stat_from_page(struct page *page) | ||
363 | { | 333 | { |
364 | return NULL; | ||
365 | } | 334 | } |
366 | 335 | ||
367 | static inline void | 336 | static inline void |