linux-stable/net
Neal Cardwell 6d022a7abf tcp: fix excessive TLP and RACK timeouts from HZ rounding
commit 1c2709cfff upstream.

We discovered from packet traces of slow loss recovery on kernels with
the default HZ=250 setting (and min_rtt < 1ms) that after reordering,
when receiving a SACKed sequence range, the RACK reordering timer was
firing after about 16ms rather than the desired value of roughly
min_rtt/4 + 2ms. The problem is largely due to the RACK reorder timer
calculation adding in TCP_TIMEOUT_MIN, which is 2 jiffies. On kernels
with HZ=250, this is 2*4ms = 8ms. The TLP timer calculation has the
exact same issue.

This commit fixes the TLP transmit timer and RACK reordering timer
floor calculation to more closely match the intended 2ms floor even on
kernels with HZ=250. It does this by adding in a new
TCP_TIMEOUT_MIN_US floor of 2000 us and then converting to jiffies,
instead of the current approach of converting to jiffies and then
adding th TCP_TIMEOUT_MIN value of 2 jiffies.

Our testing has verified that on kernels with HZ=1000, as expected,
this does not produce significant changes in behavior, but on kernels
with the default HZ=250 the latency improvement can be large. For
example, our tests show that for HZ=250 kernels at low RTTs this fix
roughly halves the latency for the RACK reorder timer: instead of
mostly firing at 16ms it mostly fires at 8ms.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Fixes: bb4d991a28 ("tcp: adjust tail loss probe timeout")
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20231015174700.2206872-1-ncardwell.sw@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-25 11:16:46 +02:00
..
6lowpan
9p 9p: virtio: make sure 'offs' is initialized in zc_request 2023-09-23 10:47:57 +02:00
802 mrp: introduce active flags to prevent UAF when applicant uninit 2023-01-18 11:30:36 +01:00
8021q vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit() 2023-05-30 12:42:11 +01:00
appletalk
atm atm: hide unused procfs functions 2023-06-09 10:24:01 +02:00
ax25 ax25: Fix UAF bugs in ax25 timers 2022-04-27 13:39:46 +02:00
batman-adv batman-adv: Fix batadv_v_ogm_aggr_send memory leak 2023-08-30 16:31:55 +02:00
bluetooth Bluetooth: avoid memcmp() out of bounds warning 2023-10-25 11:16:41 +02:00
bpf bpf, test_run: Fix alignment problem in bpf_prog_test_run_skb() 2022-11-25 17:40:29 +01:00
bpfilter
bridge net: bridge: use DEV_STATS_INC() 2023-10-10 21:44:57 +02:00
caif net: caif: Fix use-after-free in cfusbl_device_notify() 2023-03-17 08:31:44 +01:00
can can: bcm: Fix UAF in bcm_proc_show() 2023-08-11 11:45:24 +02:00
ceph libceph: fix potential hang in ceph_osdc_notify() 2023-08-11 11:45:38 +02:00
core rtnetlink: Reject negative ifindexes in RTM_NEWLINK 2023-10-10 21:45:02 +02:00
dcb net: dcb: disable softirqs in dcbnl_flush_dev() 2022-03-08 19:04:10 +01:00
dccp dccp: fix dccp_v4_err()/dccp_v6_err() again 2023-10-10 21:45:02 +02:00
decnet Remove DECnet support from kernel 2023-06-21 15:39:57 +02:00
dns_resolver
dsa net: dsa: Add missing of_node_put() in dsa_port_parse_of 2022-03-23 09:10:44 +01:00
ethernet
hsr net: hsr: Fix potential use-after-free 2022-12-08 11:18:33 +01:00
ieee802154 net: ieee802154: fix error return code in dgram_bind() 2022-11-03 23:52:30 +09:00
ife
ipv4 tcp: fix excessive TLP and RACK timeouts from HZ rounding 2023-10-25 11:16:46 +02:00
ipv6 net: ipv6: fix return value check in esp_remove_trailer 2023-10-25 11:16:45 +02:00
iucv net/iucv: Fix size of interrupt data 2023-03-22 13:27:10 +01:00
kcm kcm: Fix error handling for SOCK_DGRAM in kcm_sendmsg(). 2023-09-23 10:48:15 +02:00
key net: af_key: fix sadb_x_filter validation 2023-08-30 16:31:48 +02:00
l2tp ipv4, ipv6: Fix handling of transhdrlen in __ip{,6}_append_data() 2023-10-10 21:45:01 +02:00
l3mdev
lapb
llc llc: Don't drop packet from non-root netns. 2023-08-11 11:45:26 +02:00
mac80211 wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for non-uploaded sta 2023-04-20 12:04:38 +02:00
mac802154 mac802154: fix missing INIT_LIST_HEAD in ieee802154_if_add() 2022-12-14 11:28:28 +01:00
mpls net: mpls: fix stale pointer if allocation fails during device rename 2023-02-22 12:47:21 +01:00
ncsi
netfilter netfilter: nft_payload: fix wrong mac header matching 2023-10-25 11:16:43 +02:00
netlabel netlabel: fix shift wrapping bug in netlbl_catmap_setlong() 2023-09-23 10:47:58 +02:00
netlink netlink: Add __sock_i_ino() for __netlink_diag_dump(). 2023-08-11 11:45:07 +02:00
netrom netrom: Deny concurrent connect(). 2023-09-23 10:48:01 +02:00
nfc nfc: nci: fix possible NULL pointer dereference in send_acknowledge() 2023-10-25 11:16:42 +02:00
nsh net: nsh: Use correct mac_offset to unwind gso skb in nsh_gso_segment() 2023-05-30 12:42:11 +01:00
openvswitch net: openvswitch: fix flow memory leak in ovs_flow_cmd_new 2023-02-22 12:47:12 +01:00
packet net/packet: annotate data-races around tp->status 2023-08-16 18:13:00 +02:00
phonet phonet: refcount leak in pep_sock_accep 2022-01-11 13:58:50 +01:00
psample
qrtr net: qrtr: fix another OOB Read in qrtr_endpoint_post 2021-09-03 09:58:00 +02:00
rds net: prevent address rewrite in kernel_bind() 2023-10-25 11:16:21 +02:00
rfkill net: rfkill: gpio: prevent value glitch during probe 2023-10-25 11:16:45 +02:00
rose net/rose: Fix to not accept on connected socket 2023-02-22 12:47:19 +01:00
rxrpc rxrpc: Fix hard call timeout units 2023-05-17 11:13:24 +02:00
sched net/sched: Retire rsvp classifier 2023-09-23 10:48:18 +02:00
sctp sctp: update hb timer immediately after users change hb_interval 2023-10-10 21:45:01 +02:00
smc net/smc: Remove redundant refcount increase 2022-09-15 12:17:03 +02:00
strparser
sunrpc SUNRPC: Fix UAF in svc_tcp_listen_data_ready() 2023-08-11 11:45:20 +02:00
switchdev
tipc net: tipc: resize nlattr array to correct size 2023-06-21 15:39:59 +02:00
tls net/tls: Fix race in TLS device down flow 2022-07-29 17:10:32 +02:00
unix af_unix: Fix data-race around unix_tot_inflight. 2023-09-23 10:48:13 +02:00
vmw_vsock vsock: avoid to close connected socket after the timeout 2023-05-30 12:42:10 +01:00
wimax
wireless wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point() 2023-08-11 11:45:25 +02:00
x25 net/x25: Fix to not accept on connected socket 2023-02-22 12:47:12 +01:00
xdp
xfrm xfrm: interface: use DEV_STATS_INC() 2023-10-25 11:16:44 +02:00
compat.c
Kconfig Remove DECnet support from kernel 2023-06-21 15:39:57 +02:00
Makefile Remove DECnet support from kernel 2023-06-21 15:39:57 +02:00
socket.c net: prevent address rewrite in kernel_bind() 2023-10-25 11:16:21 +02:00
sysctl_net.c