diff options
-rw-r--r-- | mm/memcontrol.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 33add96cd5fb..e46451e1d9b7 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -48,6 +48,8 @@ enum mem_cgroup_stat_index { | |||
48 | */ | 48 | */ |
49 | MEM_CGROUP_STAT_CACHE, /* # of pages charged as cache */ | 49 | MEM_CGROUP_STAT_CACHE, /* # of pages charged as cache */ |
50 | MEM_CGROUP_STAT_RSS, /* # of pages charged as rss */ | 50 | MEM_CGROUP_STAT_RSS, /* # of pages charged as rss */ |
51 | MEM_CGROUP_STAT_PGPGIN_COUNT, /* # of pages paged in */ | ||
52 | MEM_CGROUP_STAT_PGPGOUT_COUNT, /* # of pages paged out */ | ||
51 | 53 | ||
52 | MEM_CGROUP_STAT_NSTATS, | 54 | MEM_CGROUP_STAT_NSTATS, |
53 | }; | 55 | }; |
@@ -199,6 +201,13 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *mem, int flags, | |||
199 | __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_CACHE, val); | 201 | __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_CACHE, val); |
200 | else | 202 | else |
201 | __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_RSS, val); | 203 | __mem_cgroup_stat_add_safe(stat, MEM_CGROUP_STAT_RSS, val); |
204 | |||
205 | if (charge) | ||
206 | __mem_cgroup_stat_add_safe(stat, | ||
207 | MEM_CGROUP_STAT_PGPGIN_COUNT, 1); | ||
208 | else | ||
209 | __mem_cgroup_stat_add_safe(stat, | ||
210 | MEM_CGROUP_STAT_PGPGOUT_COUNT, 1); | ||
202 | } | 211 | } |
203 | 212 | ||
204 | static struct mem_cgroup_per_zone * | 213 | static struct mem_cgroup_per_zone * |
@@ -884,6 +893,8 @@ static const struct mem_cgroup_stat_desc { | |||
884 | } mem_cgroup_stat_desc[] = { | 893 | } mem_cgroup_stat_desc[] = { |
885 | [MEM_CGROUP_STAT_CACHE] = { "cache", PAGE_SIZE, }, | 894 | [MEM_CGROUP_STAT_CACHE] = { "cache", PAGE_SIZE, }, |
886 | [MEM_CGROUP_STAT_RSS] = { "rss", PAGE_SIZE, }, | 895 | [MEM_CGROUP_STAT_RSS] = { "rss", PAGE_SIZE, }, |
896 | [MEM_CGROUP_STAT_PGPGIN_COUNT] = {"pgpgin", 1, }, | ||
897 | [MEM_CGROUP_STAT_PGPGOUT_COUNT] = {"pgpgout", 1, }, | ||
887 | }; | 898 | }; |
888 | 899 | ||
889 | static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft, | 900 | static int mem_control_stat_show(struct cgroup *cont, struct cftype *cft, |