1 /* memcontrol.h - Memory Controller
3 * Copyright IBM Corporation, 2007
4 * Author Balbir Singh <balbir@linux.vnet.ibm.com>
6 * Copyright 2007 OpenVZ SWsoft Inc
7 * Author: Pavel Emelianov <xemul@openvz.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
20 #ifndef _LINUX_MEMCONTROL_H
21 #define _LINUX_MEMCONTROL_H
23 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
24 #include <linux/rcupdate.h>
28 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
34 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
35 #ifdef CONFIG_CGROUP_MEM_CONT
37 #ifdef CONFIG_CGROUP_MEM_RES_CTLR
38 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
40 extern void mm_init_cgroup(struct mm_struct
*mm
, struct task_struct
*p
);
41 extern void mm_free_cgroup(struct mm_struct
*mm
);
42 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
43 extern void page_assign_page_cgroup(struct page
*page
,
44 struct page_cgroup
*pc
);
47 #define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0)
49 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
50 extern struct page_cgroup
*page_get_page_cgroup(struct page
*page
);
51 extern int mem_cgroup_charge(struct page
*page
, struct mm_struct
*mm
,
53 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
54 extern void mem_cgroup_uncharge(struct page_cgroup
*pc
);
56 extern int mem_cgroup_cache_charge(struct page
*page
, struct mm_struct
*mm
,
58 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
59 extern void mem_cgroup_uncharge_page(struct page
*page
);
60 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
61 extern void mem_cgroup_move_lists(struct page_cgroup
*pc
, bool active
);
63 extern void mem_cgroup_move_lists(struct page
*page
, bool active
);
64 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
65 extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan
,
66 struct list_head
*dst
,
67 unsigned long *scanned
, int order
,
68 int mode
, struct zone
*z
,
69 struct mem_cgroup
*mem_cont
,
71 extern void mem_cgroup_out_of_memory(struct mem_cgroup
*mem
, gfp_t gfp_mask
);
72 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
73 extern int mem_cgroup_cache_charge(struct page
*page
, struct mm_struct
*mm
,
76 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
77 int task_in_mem_cgroup(struct task_struct
*task
, const struct mem_cgroup
*mem
);
79 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
80 #define vm_match_cgroup(mm, cgroup) \
82 #define mm_match_cgroup(mm, cgroup) \
83 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:include/linux/memcontrol.h
84 ((cgroup
) == rcu_dereference((mm
)->mem_cgroup
))
86 extern int mem_cgroup_prepare_migration(struct page
*page
);
87 extern void mem_cgroup_end_migration(struct page
*page
);
88 extern void mem_cgroup_page_migration(struct page
*page
, struct page
*newpage
);
93 extern int mem_cgroup_calc_mapped_ratio(struct mem_cgroup
*mem
);
94 extern long mem_cgroup_reclaim_imbalance(struct mem_cgroup
*mem
);
96 extern int mem_cgroup_get_reclaim_priority(struct mem_cgroup
*mem
);
97 extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup
*mem
,
99 extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup
*mem
,
102 extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup
*mem
,
103 struct zone
*zone
, int priority
);
104 extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup
*mem
,
105 struct zone
*zone
, int priority
);
107 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
108 #else /* CONFIG_CGROUP_MEM_CONT */
110 #else /* CONFIG_CGROUP_MEM_RES_CTLR */
111 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
112 static inline void mm_init_cgroup(struct mm_struct
*mm
,
113 struct task_struct
*p
)
117 static inline void mm_free_cgroup(struct mm_struct
*mm
)
121 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
122 static inline void page_assign_page_cgroup(struct page
*page
,
123 struct page_cgroup
*pc
)
125 static inline void page_reset_bad_cgroup(struct page
*page
)
126 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
130 static inline struct page_cgroup
*page_get_page_cgroup(struct page
*page
)
135 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
136 static inline int mem_cgroup_charge(struct page
*page
, struct mm_struct
*mm
,
139 static inline int mem_cgroup_charge(struct page
*page
,
140 struct mm_struct
*mm
, gfp_t gfp_mask
)
141 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
146 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
147 static inline void mem_cgroup_uncharge(struct page_cgroup
*pc
)
149 static inline int mem_cgroup_cache_charge(struct page
*page
,
150 struct mm_struct
*mm
, gfp_t gfp_mask
)
151 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
153 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
156 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
159 static inline void mem_cgroup_uncharge_page(struct page
*page
)
163 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
164 static inline void mem_cgroup_move_lists(struct page_cgroup
*pc
,
167 static inline void mem_cgroup_move_lists(struct page
*page
, bool active
)
168 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
172 <<<<<<< HEAD
:include
/linux
/memcontrol
.h
173 static inline int mem_cgroup_cache_charge(struct page
*page
,
174 struct mm_struct
*mm
,
180 static inline int vm_match_cgroup(struct mm_struct
*mm
, struct mem_cgroup
*mem
)
182 static inline int mm_match_cgroup(struct mm_struct
*mm
, struct mem_cgroup
*mem
)
183 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/memcontrol
.h
188 static inline int task_in_mem_cgroup(struct task_struct
*task
,
189 const struct mem_cgroup
*mem
)
194 static inline int mem_cgroup_prepare_migration(struct page
*page
)
199 static inline void mem_cgroup_end_migration(struct page
*page
)
204 mem_cgroup_page_migration(struct page
*page
, struct page
*newpage
)
208 static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup
*mem
)
213 static inline int mem_cgroup_reclaim_imbalance(struct mem_cgroup
*mem
)
218 static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup
*mem
)
223 static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup
*mem
,
228 static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup
*mem
,
233 static inline long mem_cgroup_calc_reclaim_active(struct mem_cgroup
*mem
,
234 struct zone
*zone
, int priority
)
239 static inline long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup
*mem
,
240 struct zone
*zone
, int priority
)
244 #endif /* CONFIG_CGROUP_MEM_CONT */
246 #endif /* _LINUX_MEMCONTROL_H */