diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2016-01-14 18:21:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-14 19:00:49 -0500 |
commit | 80f23124f57c77915a7b4201d8dcba38a38b23f0 (patch) | |
tree | d370c585d71dc17fc9b48034cdcda5b6e1b36b22 /net/ipv4/tcp_memcontrol.c | |
parent | af95d7df4059cfeab7e7c244f3564214aada7dad (diff) |
net: tcp_memcontrol: simplify the per-memcg limit access
tcp_memcontrol replicates the global sysctl_mem limit array per cgroup,
but it only ever sets these entries to the value of the memory_allocated
page_counter limit. Use the latter directly.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/ipv4/tcp_memcontrol.c')
-rw-r--r-- | net/ipv4/tcp_memcontrol.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index 6759e0d6bba1..ef4268d12e43 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
@@ -21,9 +21,6 @@ int tcp_init_cgroup(struct mem_cgroup *memcg, struct cgroup_subsys *ss) | |||
21 | if (!cg_proto) | 21 | if (!cg_proto) |
22 | return 0; | 22 | return 0; |
23 | 23 | ||
24 | cg_proto->sysctl_mem[0] = sysctl_tcp_mem[0]; | ||
25 | cg_proto->sysctl_mem[1] = sysctl_tcp_mem[1]; | ||
26 | cg_proto->sysctl_mem[2] = sysctl_tcp_mem[2]; | ||
27 | cg_proto->memory_pressure = 0; | 24 | cg_proto->memory_pressure = 0; |
28 | cg_proto->memcg = memcg; | 25 | cg_proto->memcg = memcg; |
29 | 26 | ||
@@ -54,7 +51,6 @@ EXPORT_SYMBOL(tcp_destroy_cgroup); | |||
54 | static int tcp_update_limit(struct mem_cgroup *memcg, unsigned long nr_pages) | 51 | static int tcp_update_limit(struct mem_cgroup *memcg, unsigned long nr_pages) |
55 | { | 52 | { |
56 | struct cg_proto *cg_proto; | 53 | struct cg_proto *cg_proto; |
57 | int i; | ||
58 | int ret; | 54 | int ret; |
59 | 55 | ||
60 | cg_proto = tcp_prot.proto_cgroup(memcg); | 56 | cg_proto = tcp_prot.proto_cgroup(memcg); |
@@ -65,10 +61,6 @@ static int tcp_update_limit(struct mem_cgroup *memcg, unsigned long nr_pages) | |||
65 | if (ret) | 61 | if (ret) |
66 | return ret; | 62 | return ret; |
67 | 63 | ||
68 | for (i = 0; i < 3; i++) | ||
69 | cg_proto->sysctl_mem[i] = min_t(long, nr_pages, | ||
70 | sysctl_tcp_mem[i]); | ||
71 | |||
72 | if (!cg_proto->active) { | 64 | if (!cg_proto->active) { |
73 | /* | 65 | /* |
74 | * The active flag needs to be written after the static_key | 66 | * The active flag needs to be written after the static_key |