android_kernel_motorola_sm6225/net/core
Abel Wu 98e6388d14 sock: Fix misuse of sk_under_memory_pressure()
[ Upstream commit 2d0c88e84e483982067a82073f6125490ddf3614 ]

The status of global socket memory pressure is updated when:

  a) __sk_mem_raise_allocated():

	enter: sk_memory_allocated(sk) >  sysctl_mem[1]
	leave: sk_memory_allocated(sk) <= sysctl_mem[0]

  b) __sk_mem_reduce_allocated():

	leave: sk_under_memory_pressure(sk) &&
		sk_memory_allocated(sk) < sysctl_mem[0]

So the conditions of leaving global pressure are inconstant, which
may lead to the situation that one pressured net-memcg prevents the
global pressure from being cleared when there is indeed no global
pressure, thus the global constrains are still in effect unexpectedly
on the other sockets.

This patch fixes this by ignoring the net-memcg's pressure when
deciding whether should leave global memory pressure.

Fixes: e1aab161e0 ("socket: initial cgroup code.")
Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Link: https://lore.kernel.org/r/20230816091226.1542-1-wuyun.abel@bytedance.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-30 16:31:49 +02:00
..
datagram.c net: datagram: fix data-races in datagram_poll() 2023-05-30 12:42:08 +01:00
dev.c Remove DECnet support from kernel 2023-06-21 15:39:57 +02:00
dev_addr_lists.c
dev_ioctl.c
devlink.c
drop_monitor.c drop_monitor: fix data-race in dropmon_net_event / trace_napi_poll_hit 2022-02-23 11:58:39 +01:00
dst.c
dst_cache.c
ethtool.c net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats 2023-01-24 07:11:49 +01:00
failover.c
fib_notifier.c
fib_rules.c
filter.c bpf: Always return target ifindex in bpf_fib_lookup 2023-02-22 12:47:19 +01:00
flow_dissector.c net/sched: flower: fix parsing of ethertype following VLAN header 2022-04-20 09:12:48 +02:00
gen_estimator.c
gen_stats.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
Makefile
neighbour.c neighbour: delete neigh_lookup_nodev as not used 2023-06-21 15:39:59 +02:00
net-procfs.c net-procfs: show net devices bound packet types 2022-02-08 18:23:09 +01:00
net-sysfs.c net-sysfs: add check for netdevice being present to speed_show 2022-03-16 13:20:27 +01:00
net-sysfs.h
net-traces.c
net_namespace.c net: fix UaF in netns ops registration error path 2023-02-06 07:49:42 +01:00
netclassid_cgroup.c
netevent.c
netpoll.c net: don't let netpoll invoke NAPI if in xmit context 2023-04-20 12:04:38 +02:00
netprio_cgroup.c
page_pool.c
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c netlink: do not hard code device address lenth in fdb dumps 2023-08-11 11:45:06 +02:00
scm.c
secure_seq.c secure_seq: use the 64 bits of the siphash for port offset calculation 2022-06-06 08:24:20 +02:00
skbuff.c net: fix skb leak in __skb_tstamp_tx() 2023-05-30 12:42:14 +01:00
sock.c sock: Fix misuse of sk_under_memory_pressure() 2023-08-30 16:31:49 +02:00
sock_diag.c
sock_reuseport.c
stream.c tcp: reduce POLLOUT events caused by TCP_NOTSENT_LOWAT 2023-05-30 12:42:07 +01:00
sysctl_net_core.c net: Fix data-races around weight_p and dev_weight_[rt]x_bias. 2022-09-05 10:26:30 +02:00
timestamping.c
tso.c
utils.c
xdp.c