aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r--include/linux/memcontrol.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index affd5b19b86c..b96600786913 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -39,6 +39,16 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
39 struct mem_cgroup *mem_cont, 39 struct mem_cgroup *mem_cont,
40 int active, int file); 40 int active, int file);
41 41
42struct memcg_scanrecord {
43 struct mem_cgroup *mem; /* scanend memory cgroup */
44 struct mem_cgroup *root; /* scan target hierarchy root */
45 int context; /* scanning context (see memcontrol.c) */
46 unsigned long nr_scanned[2]; /* the number of scanned pages */
47 unsigned long nr_rotated[2]; /* the number of rotated pages */
48 unsigned long nr_freed[2]; /* the number of freed pages */
49 unsigned long elapsed; /* nsec of time elapsed while scanning */
50};
51
42#ifdef CONFIG_CGROUP_MEM_RES_CTLR 52#ifdef CONFIG_CGROUP_MEM_RES_CTLR
43/* 53/*
44 * All "charge" functions with gfp_mask should use GFP_KERNEL or 54 * All "charge" functions with gfp_mask should use GFP_KERNEL or
@@ -119,6 +129,15 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page);
119extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, 129extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
120 struct task_struct *p); 130 struct task_struct *p);
121 131
132extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
133 gfp_t gfp_mask, bool noswap,
134 struct memcg_scanrecord *rec);
135extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
136 gfp_t gfp_mask, bool noswap,
137 struct zone *zone,
138 struct memcg_scanrecord *rec,
139 unsigned long *nr_scanned);
140
122#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 141#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
123extern int do_swap_account; 142extern int do_swap_account;
124#endif 143#endif