Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278747
b: refs/heads/master
c: 0850f0f
h: refs/heads/master
i:
  278745: 062430a
  278743: 0c3a0e5
v: v3
  • Loading branch information
Glauber Costa authored and David S. Miller committed Dec 13, 2011
1 parent 21e5110 commit 8fd2503
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffea59e50494198a0db4d6ad8f6721b8fd994f65
refs/heads/master: 0850f0f5c54261a6236f013e8bac154bcce424d6
12 changes: 11 additions & 1 deletion trunk/net/ipv4/tcp_memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ static struct cftype tcp_files[] = {
.trigger = tcp_cgroup_reset,
.read_u64 = tcp_cgroup_read,
},
{
.name = "kmem.tcp.max_usage_in_bytes",
.private = RES_MAX_USAGE,
.trigger = tcp_cgroup_reset,
.read_u64 = tcp_cgroup_read,
},
};

static inline struct tcp_memcontrol *tcp_from_cgproto(struct cg_proto *cg_proto)
Expand Down Expand Up @@ -205,7 +211,8 @@ static u64 tcp_cgroup_read(struct cgroup *cont, struct cftype *cft)
val = tcp_read_usage(memcg);
break;
case RES_FAILCNT:
val = tcp_read_stat(memcg, RES_FAILCNT, 0);
case RES_MAX_USAGE:
val = tcp_read_stat(memcg, cft->private, 0);
break;
default:
BUG();
Expand All @@ -226,6 +233,9 @@ static int tcp_cgroup_reset(struct cgroup *cont, unsigned int event)
tcp = tcp_from_cgproto(cg_proto);

switch (event) {
case RES_MAX_USAGE:
res_counter_reset_max(&tcp->tcp_memory_allocated);
break;
case RES_FAILCNT:
res_counter_reset_failcnt(&tcp->tcp_memory_allocated);
break;
Expand Down

0 comments on commit 8fd2503

Please sign in to comment.