Re: [PATCH v3 4/7] per-cgroup tcp buffers control
From: KAMEZAWA Hiroyuki <hidden>
Date: 2011-09-26 10:59:57
Also in:
lkml, netdev
On Sun, 18 Sep 2011 21:56:42 -0300 Glauber Costa [off-list ref] wrote:
With all the infrastructure in place, this patch implements per-cgroup control for tcp memory pressure handling. Signed-off-by: Glauber Costa <redacted> CC: David S. Miller <davem@davemloft.net> CC: Hiroyouki Kamezawa <redacted> CC: Eric W. Biederman <redacted>
a comment below.
+int tcp_init_cgroup(struct proto *prot, struct cgroup *cgrp,
+ struct cgroup_subsys *ss)
+{
+ struct mem_cgroup *cg = mem_cgroup_from_cont(cgrp);
+ unsigned long limit;
+
+ cg->tcp_memory_pressure = 0;
+ atomic_long_set(&cg->tcp_memory_allocated, 0);
+ percpu_counter_init(&cg->tcp_sockets_allocated, 0);
+
+ limit = nr_free_buffer_pages() / 8;
+ limit = max(limit, 128UL);
+
+ cg->tcp_prot_mem[0] = sysctl_tcp_mem[0];
+ cg->tcp_prot_mem[1] = sysctl_tcp_mem[1];
+ cg->tcp_prot_mem[2] = sysctl_tcp_mem[2];
+
Then, the parameter doesn't inherit parent's one ?
I think sockets_populate should pass 'parent' and
I think you should have a function
mem_cgroup_should_inherit_parent_settings(parent)
(This is because you made this feature as a part of memcg.
please provide expected behavior.)
Thanks,
-Kame
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>