diff options
author | Glauber Costa <glommer@parallels.com> | 2011-12-11 16:47:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-12 19:04:10 -0500 |
commit | 180d8cd942ce336b2c869d324855c40c5db478ad (patch) | |
tree | 2424d854345d81464d6030ef8090a8e22bd414b0 /net/ipv4/proc.c | |
parent | e5671dfae59b165e2adfd4dfbdeab11ac8db5bda (diff) |
foundations of per-cgroup memory pressure controlling.
This patch replaces all uses of struct sock fields' memory_pressure,
memory_allocated, sockets_allocated, and sysctl_mem to acessor
macros. Those macros can either receive a socket argument, or a mem_cgroup
argument, depending on the context they live in.
Since we're only doing a macro wrapping here, no performance impact at all is
expected in the case where we don't have cgroups disabled.
Signed-off-by: Glauber Costa <glommer@parallels.com>
Reviewed-by: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
CC: David S. Miller <davem@davemloft.net>
CC: Eric W. Biederman <ebiederm@xmission.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/proc.c')
-rw-r--r-- | net/ipv4/proc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index 961eed4f510a..3569d8ecaeac 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
@@ -56,17 +56,17 @@ static int sockstat_seq_show(struct seq_file *seq, void *v) | |||
56 | 56 | ||
57 | local_bh_disable(); | 57 | local_bh_disable(); |
58 | orphans = percpu_counter_sum_positive(&tcp_orphan_count); | 58 | orphans = percpu_counter_sum_positive(&tcp_orphan_count); |
59 | sockets = percpu_counter_sum_positive(&tcp_sockets_allocated); | 59 | sockets = proto_sockets_allocated_sum_positive(&tcp_prot); |
60 | local_bh_enable(); | 60 | local_bh_enable(); |
61 | 61 | ||
62 | socket_seq_show(seq); | 62 | socket_seq_show(seq); |
63 | seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %ld\n", | 63 | seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %ld\n", |
64 | sock_prot_inuse_get(net, &tcp_prot), orphans, | 64 | sock_prot_inuse_get(net, &tcp_prot), orphans, |
65 | tcp_death_row.tw_count, sockets, | 65 | tcp_death_row.tw_count, sockets, |
66 | atomic_long_read(&tcp_memory_allocated)); | 66 | proto_memory_allocated(&tcp_prot)); |
67 | seq_printf(seq, "UDP: inuse %d mem %ld\n", | 67 | seq_printf(seq, "UDP: inuse %d mem %ld\n", |
68 | sock_prot_inuse_get(net, &udp_prot), | 68 | sock_prot_inuse_get(net, &udp_prot), |
69 | atomic_long_read(&udp_memory_allocated)); | 69 | proto_memory_allocated(&udp_prot)); |
70 | seq_printf(seq, "UDPLITE: inuse %d\n", | 70 | seq_printf(seq, "UDPLITE: inuse %d\n", |
71 | sock_prot_inuse_get(net, &udplite_prot)); | 71 | sock_prot_inuse_get(net, &udplite_prot)); |
72 | seq_printf(seq, "RAW: inuse %d\n", | 72 | seq_printf(seq, "RAW: inuse %d\n", |