diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_memcontrol.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index d438fba31ba8..171d7b64f803 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
@@ -29,6 +29,12 @@ static struct cftype tcp_files[] = { | |||
29 | .trigger = tcp_cgroup_reset, | 29 | .trigger = tcp_cgroup_reset, |
30 | .read_u64 = tcp_cgroup_read, | 30 | .read_u64 = tcp_cgroup_read, |
31 | }, | 31 | }, |
32 | { | ||
33 | .name = "kmem.tcp.max_usage_in_bytes", | ||
34 | .private = RES_MAX_USAGE, | ||
35 | .trigger = tcp_cgroup_reset, | ||
36 | .read_u64 = tcp_cgroup_read, | ||
37 | }, | ||
32 | }; | 38 | }; |
33 | 39 | ||
34 | static inline struct tcp_memcontrol *tcp_from_cgproto(struct cg_proto *cg_proto) | 40 | static inline struct tcp_memcontrol *tcp_from_cgproto(struct cg_proto *cg_proto) |
@@ -205,7 +211,8 @@ static u64 tcp_cgroup_read(struct cgroup *cont, struct cftype *cft) | |||
205 | val = tcp_read_usage(memcg); | 211 | val = tcp_read_usage(memcg); |
206 | break; | 212 | break; |
207 | case RES_FAILCNT: | 213 | case RES_FAILCNT: |
208 | val = tcp_read_stat(memcg, RES_FAILCNT, 0); | 214 | case RES_MAX_USAGE: |
215 | val = tcp_read_stat(memcg, cft->private, 0); | ||
209 | break; | 216 | break; |
210 | default: | 217 | default: |
211 | BUG(); | 218 | BUG(); |
@@ -226,6 +233,9 @@ static int tcp_cgroup_reset(struct cgroup *cont, unsigned int event) | |||
226 | tcp = tcp_from_cgproto(cg_proto); | 233 | tcp = tcp_from_cgproto(cg_proto); |
227 | 234 | ||
228 | switch (event) { | 235 | switch (event) { |
236 | case RES_MAX_USAGE: | ||
237 | res_counter_reset_max(&tcp->tcp_memory_allocated); | ||
238 | break; | ||
229 | case RES_FAILCNT: | 239 | case RES_FAILCNT: |
230 | res_counter_reset_failcnt(&tcp->tcp_memory_allocated); | 240 | res_counter_reset_failcnt(&tcp->tcp_memory_allocated); |
231 | break; | 241 | break; |