You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
David S. Miller
parent
e5671dfae5
commit
180d8cd942
+3
-3
@@ -56,17 +56,17 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
|
||||
|
||||
local_bh_disable();
|
||||
orphans = percpu_counter_sum_positive(&tcp_orphan_count);
|
||||
sockets = percpu_counter_sum_positive(&tcp_sockets_allocated);
|
||||
sockets = proto_sockets_allocated_sum_positive(&tcp_prot);
|
||||
local_bh_enable();
|
||||
|
||||
socket_seq_show(seq);
|
||||
seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %ld\n",
|
||||
sock_prot_inuse_get(net, &tcp_prot), orphans,
|
||||
tcp_death_row.tw_count, sockets,
|
||||
atomic_long_read(&tcp_memory_allocated));
|
||||
proto_memory_allocated(&tcp_prot));
|
||||
seq_printf(seq, "UDP: inuse %d mem %ld\n",
|
||||
sock_prot_inuse_get(net, &udp_prot),
|
||||
atomic_long_read(&udp_memory_allocated));
|
||||
proto_memory_allocated(&udp_prot));
|
||||
seq_printf(seq, "UDPLITE: inuse %d\n",
|
||||
sock_prot_inuse_get(net, &udplite_prot));
|
||||
seq_printf(seq, "RAW: inuse %d\n",
|
||||
|
||||
Reference in New Issue
Block a user