diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2012-05-29 18:07:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:27 -0400 |
commit | 13114716c744afe165c2148c944ed0306658921c (patch) | |
tree | 3b0d3022ae3b9725bc0243414e6f74939bbdaeb1 /mm | |
parent | 78ccf5b5ab834080db25d8128e7dd33594cbf4df (diff) |
mm: memcg: keep ratelimit counter separate from event counters
All events except the ratelimit counter are statistics exported to
userspace. Keep this internal value out of the event count array.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Ying Han <yinghan@google.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4200f5c59579..b7b230606f2c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -94,7 +94,6 @@ enum mem_cgroup_stat_index { | |||
94 | enum mem_cgroup_events_index { | 94 | enum mem_cgroup_events_index { |
95 | MEM_CGROUP_EVENTS_PGPGIN, /* # of pages paged in */ | 95 | MEM_CGROUP_EVENTS_PGPGIN, /* # of pages paged in */ |
96 | MEM_CGROUP_EVENTS_PGPGOUT, /* # of pages paged out */ | 96 | MEM_CGROUP_EVENTS_PGPGOUT, /* # of pages paged out */ |
97 | MEM_CGROUP_EVENTS_COUNT, /* # of pages paged in/out */ | ||
98 | MEM_CGROUP_EVENTS_PGFAULT, /* # of page-faults */ | 97 | MEM_CGROUP_EVENTS_PGFAULT, /* # of page-faults */ |
99 | MEM_CGROUP_EVENTS_PGMAJFAULT, /* # of major page-faults */ | 98 | MEM_CGROUP_EVENTS_PGMAJFAULT, /* # of major page-faults */ |
100 | MEM_CGROUP_EVENTS_NSTATS, | 99 | MEM_CGROUP_EVENTS_NSTATS, |
@@ -118,6 +117,7 @@ enum mem_cgroup_events_target { | |||
118 | struct mem_cgroup_stat_cpu { | 117 | struct mem_cgroup_stat_cpu { |
119 | long count[MEM_CGROUP_STAT_NSTATS]; | 118 | long count[MEM_CGROUP_STAT_NSTATS]; |
120 | unsigned long events[MEM_CGROUP_EVENTS_NSTATS]; | 119 | unsigned long events[MEM_CGROUP_EVENTS_NSTATS]; |
120 | unsigned long nr_page_events; | ||
121 | unsigned long targets[MEM_CGROUP_NTARGETS]; | 121 | unsigned long targets[MEM_CGROUP_NTARGETS]; |
122 | }; | 122 | }; |
123 | 123 | ||
@@ -716,7 +716,7 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *memcg, | |||
716 | nr_pages = -nr_pages; /* for event */ | 716 | nr_pages = -nr_pages; /* for event */ |
717 | } | 717 | } |
718 | 718 | ||
719 | __this_cpu_add(memcg->stat->events[MEM_CGROUP_EVENTS_COUNT], nr_pages); | 719 | __this_cpu_add(memcg->stat->nr_page_events, nr_pages); |
720 | 720 | ||
721 | preempt_enable(); | 721 | preempt_enable(); |
722 | } | 722 | } |
@@ -777,7 +777,7 @@ static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg, | |||
777 | { | 777 | { |
778 | unsigned long val, next; | 778 | unsigned long val, next; |
779 | 779 | ||
780 | val = __this_cpu_read(memcg->stat->events[MEM_CGROUP_EVENTS_COUNT]); | 780 | val = __this_cpu_read(memcg->stat->nr_page_events); |
781 | next = __this_cpu_read(memcg->stat->targets[target]); | 781 | next = __this_cpu_read(memcg->stat->targets[target]); |
782 | /* from time_after() in jiffies.h */ | 782 | /* from time_after() in jiffies.h */ |
783 | if ((long)next - (long)val < 0) { | 783 | if ((long)next - (long)val < 0) { |