diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-10-19 19:25:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-21 18:43:02 -0400 |
commit | a4fe34bf902b8f709c635ab37f1f39de0b86cff2 (patch) | |
tree | 955c388e64c320eda8759bd970a5284473c8e1d5 /net/ipv4/tcp_memcontrol.c | |
parent | f594d63199688ad568fb69f6a790b11d6d6d1ba5 (diff) |
tcp_memcontrol: Remove the per netns control.
The code that is implemented is per memory cgroup not per netns, and
having per netns bits is just confusing. Remove the per netns bits to
make it easier to see what is really going on.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_memcontrol.c')
-rw-r--r-- | net/ipv4/tcp_memcontrol.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index e7c01fcf5716..86feaa0d6d70 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
@@ -29,7 +29,6 @@ int tcp_init_cgroup(struct mem_cgroup *memcg, struct cgroup_subsys *ss) | |||
29 | struct cg_proto *cg_proto, *parent_cg; | 29 | struct cg_proto *cg_proto, *parent_cg; |
30 | struct tcp_memcontrol *tcp; | 30 | struct tcp_memcontrol *tcp; |
31 | struct mem_cgroup *parent = parent_mem_cgroup(memcg); | 31 | struct mem_cgroup *parent = parent_mem_cgroup(memcg); |
32 | struct net *net = current->nsproxy->net_ns; | ||
33 | 32 | ||
34 | cg_proto = tcp_prot.proto_cgroup(memcg); | 33 | cg_proto = tcp_prot.proto_cgroup(memcg); |
35 | if (!cg_proto) | 34 | if (!cg_proto) |
@@ -37,9 +36,9 @@ int tcp_init_cgroup(struct mem_cgroup *memcg, struct cgroup_subsys *ss) | |||
37 | 36 | ||
38 | tcp = tcp_from_cgproto(cg_proto); | 37 | tcp = tcp_from_cgproto(cg_proto); |
39 | 38 | ||
40 | tcp->tcp_prot_mem[0] = net->ipv4.sysctl_tcp_mem[0]; | 39 | tcp->tcp_prot_mem[0] = sysctl_tcp_mem[0]; |
41 | tcp->tcp_prot_mem[1] = net->ipv4.sysctl_tcp_mem[1]; | 40 | tcp->tcp_prot_mem[1] = sysctl_tcp_mem[1]; |
42 | tcp->tcp_prot_mem[2] = net->ipv4.sysctl_tcp_mem[2]; | 41 | tcp->tcp_prot_mem[2] = sysctl_tcp_mem[2]; |
43 | tcp->tcp_memory_pressure = 0; | 42 | tcp->tcp_memory_pressure = 0; |
44 | 43 | ||
45 | parent_cg = tcp_prot.proto_cgroup(parent); | 44 | parent_cg = tcp_prot.proto_cgroup(parent); |
@@ -76,7 +75,6 @@ EXPORT_SYMBOL(tcp_destroy_cgroup); | |||
76 | 75 | ||
77 | static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) | 76 | static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) |
78 | { | 77 | { |
79 | struct net *net = current->nsproxy->net_ns; | ||
80 | struct tcp_memcontrol *tcp; | 78 | struct tcp_memcontrol *tcp; |
81 | struct cg_proto *cg_proto; | 79 | struct cg_proto *cg_proto; |
82 | u64 old_lim; | 80 | u64 old_lim; |
@@ -99,7 +97,7 @@ static int tcp_update_limit(struct mem_cgroup *memcg, u64 val) | |||
99 | 97 | ||
100 | for (i = 0; i < 3; i++) | 98 | for (i = 0; i < 3; i++) |
101 | tcp->tcp_prot_mem[i] = min_t(long, val >> PAGE_SHIFT, | 99 | tcp->tcp_prot_mem[i] = min_t(long, val >> PAGE_SHIFT, |
102 | net->ipv4.sysctl_tcp_mem[i]); | 100 | sysctl_tcp_mem[i]); |
103 | 101 | ||
104 | if (val == RES_COUNTER_MAX) | 102 | if (val == RES_COUNTER_MAX) |
105 | clear_bit(MEMCG_SOCK_ACTIVE, &cg_proto->flags); | 103 | clear_bit(MEMCG_SOCK_ACTIVE, &cg_proto->flags); |