kernel_optimize_test/net/core
Shakeel Butt d752a49865 net: memcg: late association of sock to memcg
If a TCP socket is allocated in IRQ context or cloned from unassociated
(i.e. not associated to a memcg) in IRQ context then it will remain
unassociated for its whole life. Almost half of the TCPs created on the
system are created in IRQ context, so, memory used by such sockets will
not be accounted by the memcg.

This issue is more widespread in cgroup v1 where network memory
accounting is opt-in but it can happen in cgroup v2 if the source socket
for the cloning was created in root memcg.

To fix the issue, just do the association of the sockets at the accept()
time in the process context and then force charge the memory buffer
already used and reserved by the socket.

Signed-off-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-10 15:33:05 -07:00
..
bpf_sk_storage.c
datagram.c
datagram.h
dev_addr_lists.c
dev_ioctl.c
dev.c net: Fix Tx hash bound checking 2020-02-26 11:14:10 -08:00
devlink.c devlink: validate length of region addr/len 2020-03-03 13:28:48 -08:00
drop_monitor.c
dst_cache.c
dst.c
failover.c
fib_notifier.c
fib_rules.c net: fib_rules: Correctly set table field when table number exceeds 8 bits 2020-02-16 18:38:24 -08:00
filter.c
flow_dissector.c
flow_offload.c
gen_estimator.c
gen_stats.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
Makefile
neighbour.c
net_namespace.c
net-procfs.c
net-sysfs.c
net-sysfs.h
net-traces.c
netclassid_cgroup.c cgroup, netclassid: periodically release file_lock on classid updating 2020-03-09 18:13:39 -07:00
netevent.c
netpoll.c
netprio_cgroup.c
page_pool.c page_pool: refill page when alloc.count of pool is zero 2020-02-13 14:11:51 -08:00
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c net: rtnetlink: fix bugs in rtnl_alt_ifname() 2020-02-16 18:51:59 -08:00
scm.c
secure_seq.c
skbuff.c net: core: Distribute switch variables for initialization 2020-02-20 10:00:19 -08:00
skmsg.c
sock_diag.c
sock_map.c
sock_reuseport.c
sock.c net: memcg: late association of sock to memcg 2020-03-10 15:33:05 -07:00
stream.c
sysctl_net_core.c
timestamping.c
tso.c
utils.c
xdp.c