aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 49d80814798b..350a14da6525 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -855,6 +855,17 @@ static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft,
855 mem_cgroup_write_strategy); 855 mem_cgroup_write_strategy);
856} 856}
857 857
858static ssize_t mem_cgroup_max_reset(struct cgroup *cont, struct cftype *cft,
859 struct file *file, const char __user *userbuf,
860 size_t nbytes, loff_t *ppos)
861{
862 struct mem_cgroup *mem;
863
864 mem = mem_cgroup_from_cont(cont);
865 res_counter_reset_max(&mem->res);
866 return nbytes;
867}
868
858static ssize_t mem_force_empty_write(struct cgroup *cont, 869static ssize_t mem_force_empty_write(struct cgroup *cont,
859 struct cftype *cft, struct file *file, 870 struct cftype *cft, struct file *file,
860 const char __user *userbuf, 871 const char __user *userbuf,
@@ -910,6 +921,12 @@ static struct cftype mem_cgroup_files[] = {
910 .read_u64 = mem_cgroup_read, 921 .read_u64 = mem_cgroup_read,
911 }, 922 },
912 { 923 {
924 .name = "max_usage_in_bytes",
925 .private = RES_MAX_USAGE,
926 .write = mem_cgroup_max_reset,
927 .read_u64 = mem_cgroup_read,
928 },
929 {
913 .name = "limit_in_bytes", 930 .name = "limit_in_bytes",
914 .private = RES_LIMIT, 931 .private = RES_LIMIT,
915 .write = mem_cgroup_write, 932 .write = mem_cgroup_write,