diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index eb9571815f0c..4ad3e6be045d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -2123,6 +2123,20 @@ static int mem_cgroup_write(struct cgroup *cont, struct cftype *cft, | |||
2123 | else | 2123 | else |
2124 | ret = mem_cgroup_resize_memsw_limit(memcg, val); | 2124 | ret = mem_cgroup_resize_memsw_limit(memcg, val); |
2125 | break; | 2125 | break; |
2126 | case RES_SOFT_LIMIT: | ||
2127 | ret = res_counter_memparse_write_strategy(buffer, &val); | ||
2128 | if (ret) | ||
2129 | break; | ||
2130 | /* | ||
2131 | * For memsw, soft limits are hard to implement in terms | ||
2132 | * of semantics, for now, we support soft limits for | ||
2133 | * control without swap | ||
2134 | */ | ||
2135 | if (type == _MEM) | ||
2136 | ret = res_counter_set_soft_limit(&memcg->res, val); | ||
2137 | else | ||
2138 | ret = -EINVAL; | ||
2139 | break; | ||
2126 | default: | 2140 | default: |
2127 | ret = -EINVAL; /* should be BUG() ? */ | 2141 | ret = -EINVAL; /* should be BUG() ? */ |
2128 | break; | 2142 | break; |
@@ -2376,6 +2390,12 @@ static struct cftype mem_cgroup_files[] = { | |||
2376 | .read_u64 = mem_cgroup_read, | 2390 | .read_u64 = mem_cgroup_read, |
2377 | }, | 2391 | }, |
2378 | { | 2392 | { |
2393 | .name = "soft_limit_in_bytes", | ||
2394 | .private = MEMFILE_PRIVATE(_MEM, RES_SOFT_LIMIT), | ||
2395 | .write_string = mem_cgroup_write, | ||
2396 | .read_u64 = mem_cgroup_read, | ||
2397 | }, | ||
2398 | { | ||
2379 | .name = "failcnt", | 2399 | .name = "failcnt", |
2380 | .private = MEMFILE_PRIVATE(_MEM, RES_FAILCNT), | 2400 | .private = MEMFILE_PRIVATE(_MEM, RES_FAILCNT), |
2381 | .trigger = mem_cgroup_reset, | 2401 | .trigger = mem_cgroup_reset, |