|
@@ -855,6 +855,17 @@ static ssize_t mem_cgroup_write(struct cgroup *cont, struct cftype *cft,
|
|
mem_cgroup_write_strategy);
|
|
mem_cgroup_write_strategy);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static ssize_t mem_cgroup_max_reset(struct cgroup *cont, struct cftype *cft,
|
|
|
|
+ struct file *file, const char __user *userbuf,
|
|
|
|
+ size_t nbytes, loff_t *ppos)
|
|
|
|
+{
|
|
|
|
+ struct mem_cgroup *mem;
|
|
|
|
+
|
|
|
|
+ mem = mem_cgroup_from_cont(cont);
|
|
|
|
+ res_counter_reset_max(&mem->res);
|
|
|
|
+ return nbytes;
|
|
|
|
+}
|
|
|
|
+
|
|
static ssize_t mem_force_empty_write(struct cgroup *cont,
|
|
static ssize_t mem_force_empty_write(struct cgroup *cont,
|
|
struct cftype *cft, struct file *file,
|
|
struct cftype *cft, struct file *file,
|
|
const char __user *userbuf,
|
|
const char __user *userbuf,
|
|
@@ -909,6 +920,12 @@ static struct cftype mem_cgroup_files[] = {
|
|
.private = RES_USAGE,
|
|
.private = RES_USAGE,
|
|
.read_u64 = mem_cgroup_read,
|
|
.read_u64 = mem_cgroup_read,
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ .name = "max_usage_in_bytes",
|
|
|
|
+ .private = RES_MAX_USAGE,
|
|
|
|
+ .write = mem_cgroup_max_reset,
|
|
|
|
+ .read_u64 = mem_cgroup_read,
|
|
|
|
+ },
|
|
{
|
|
{
|
|
.name = "limit_in_bytes",
|
|
.name = "limit_in_bytes",
|
|
.private = RES_LIMIT,
|
|
.private = RES_LIMIT,
|