You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
cf475ad28a
commit
c84872e168
@@ -28,6 +28,8 @@ int res_counter_charge_locked(struct res_counter *counter, unsigned long val)
|
||||
}
|
||||
|
||||
counter->usage += val;
|
||||
if (counter->usage > counter->max_usage)
|
||||
counter->max_usage = counter->usage;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -66,6 +68,8 @@ res_counter_member(struct res_counter *counter, int member)
|
||||
switch (member) {
|
||||
case RES_USAGE:
|
||||
return &counter->usage;
|
||||
case RES_MAX_USAGE:
|
||||
return &counter->max_usage;
|
||||
case RES_LIMIT:
|
||||
return &counter->limit;
|
||||
case RES_FAILCNT:
|
||||
|
||||
Reference in New Issue
Block a user