aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-29 04:00:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:10 -0400
commitc84872e168d10926acd2dee975d19172eef79252 (patch)
treec28f4f87ad38b524fe2a4c1e0e590bea3aacd92a /kernel
parentcf475ad28ac35cc9ba612d67158f29b73b38b05d (diff)
memcgroup: add the max_usage member on the res_counter
This field is the maximal value of the usage one since the counter creation (or since the latest reset). To reset this to the usage value simply write anything to the appropriate cgroup file. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/res_counter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/res_counter.c b/kernel/res_counter.c
index 70587657dda3..d3c61b4ebef2 100644
--- a/kernel/res_counter.c
+++ b/kernel/res_counter.c
@@ -28,6 +28,8 @@ int res_counter_charge_locked(struct res_counter *counter, unsigned long val)
28 } 28 }
29 29
30 counter->usage += val; 30 counter->usage += val;
31 if (counter->usage > counter->max_usage)
32 counter->max_usage = counter->usage;
31 return 0; 33 return 0;
32} 34}
33 35
@@ -66,6 +68,8 @@ res_counter_member(struct res_counter *counter, int member)
66 switch (member) { 68 switch (member) {
67 case RES_USAGE: 69 case RES_USAGE:
68 return &counter->usage; 70 return &counter->usage;
71 case RES_MAX_USAGE:
72 return &counter->max_usage;
69 case RES_LIMIT: 73 case RES_LIMIT:
70 return &counter->limit; 74 return &counter->limit;
71 case RES_FAILCNT: 75 case RES_FAILCNT: