diff options
Diffstat (limited to 'net/ipv4/tcp_memcontrol.c')
| -rw-r--r-- | net/ipv4/tcp_memcontrol.c | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index e795272fbe9e..4d3ee407d2d8 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
| @@ -6,36 +6,7 @@ | |||
| 6 | #include <linux/memcontrol.h> | 6 | #include <linux/memcontrol.h> |
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 8 | 8 | ||
| 9 | static u64 tcp_cgroup_read(struct cgroup *cont, struct cftype *cft); | 9 | static struct cftype tcp_files[4]; /* XXX: will be removed soon */ |
| 10 | static int tcp_cgroup_write(struct cgroup *cont, struct cftype *cft, | ||
| 11 | const char *buffer); | ||
| 12 | static int tcp_cgroup_reset(struct cgroup *cont, unsigned int event); | ||
| 13 | |||
| 14 | static struct cftype tcp_files[] = { | ||
| 15 | { | ||
| 16 | .name = "kmem.tcp.limit_in_bytes", | ||
| 17 | .write_string = tcp_cgroup_write, | ||
| 18 | .read_u64 = tcp_cgroup_read, | ||
| 19 | .private = RES_LIMIT, | ||
| 20 | }, | ||
| 21 | { | ||
| 22 | .name = "kmem.tcp.usage_in_bytes", | ||
| 23 | .read_u64 = tcp_cgroup_read, | ||
| 24 | .private = RES_USAGE, | ||
| 25 | }, | ||
| 26 | { | ||
| 27 | .name = "kmem.tcp.failcnt", | ||
| 28 | .private = RES_FAILCNT, | ||
| 29 | .trigger = tcp_cgroup_reset, | ||
| 30 | .read_u64 = tcp_cgroup_read, | ||
| 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 | }, | ||
| 38 | }; | ||
| 39 | 10 | ||
| 40 | static inline struct tcp_memcontrol *tcp_from_cgproto(struct cg_proto *cg_proto) | 11 | static inline struct tcp_memcontrol *tcp_from_cgproto(struct cg_proto *cg_proto) |
| 41 | { | 12 | { |
| @@ -270,3 +241,29 @@ void tcp_prot_mem(struct mem_cgroup *memcg, long val, int idx) | |||
| 270 | 241 | ||
| 271 | tcp->tcp_prot_mem[idx] = val; | 242 | tcp->tcp_prot_mem[idx] = val; |
| 272 | } | 243 | } |
| 244 | |||
| 245 | static struct cftype tcp_files[] = { | ||
| 246 | { | ||
| 247 | .name = "kmem.tcp.limit_in_bytes", | ||
| 248 | .write_string = tcp_cgroup_write, | ||
| 249 | .read_u64 = tcp_cgroup_read, | ||
| 250 | .private = RES_LIMIT, | ||
| 251 | }, | ||
| 252 | { | ||
| 253 | .name = "kmem.tcp.usage_in_bytes", | ||
| 254 | .read_u64 = tcp_cgroup_read, | ||
| 255 | .private = RES_USAGE, | ||
| 256 | }, | ||
| 257 | { | ||
| 258 | .name = "kmem.tcp.failcnt", | ||
| 259 | .private = RES_FAILCNT, | ||
| 260 | .trigger = tcp_cgroup_reset, | ||
| 261 | .read_u64 = tcp_cgroup_read, | ||
| 262 | }, | ||
| 263 | { | ||
| 264 | .name = "kmem.tcp.max_usage_in_bytes", | ||
| 265 | .private = RES_MAX_USAGE, | ||
| 266 | .trigger = tcp_cgroup_reset, | ||
| 267 | .read_u64 = tcp_cgroup_read, | ||
| 268 | }, | ||
| 269 | }; | ||
