From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Stefan Wahren <wahrenst@gmx.net>,
Eric Dumazet <edumazet@google.com>,
Neal Cardwell <ncardwell@google.com>,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH 4.19 58/98] tcp: tsq: relax tcp_small_queue_check() when rtx queue contains a single skb
Date: Mon, 23 Oct 2023 12:56:47 +0200 [thread overview]
Message-ID: <20231023104815.661613824@linuxfoundation.org> (raw)
In-Reply-To: <20231023104813.580375891@linuxfoundation.org>
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
commit f921a4a5bffa8a0005b190fb9421a7fc1fd716b6 upstream.
In commit 75eefc6c59fd ("tcp: tsq: add a shortcut in tcp_small_queue_check()")
we allowed to send an skb regardless of TSQ limits being hit if rtx queue
was empty or had a single skb, in order to better fill the pipe
when/if TX completions were slow.
Then later, commit 75c119afe14f ("tcp: implement rb-tree based
retransmit queue") accidentally removed the special case for
one skb in rtx queue.
Stefan Wahren reported a regression in single TCP flow throughput
using a 100Mbit fec link, starting from commit 65466904b015 ("tcp: adjust
TSO packet sizes based on min_rtt"). This last commit only made the
regression more visible, because it locked the TCP flow on a particular
behavior where TSQ prevented two skbs being pushed downstream,
adding silences on the wire between each TSO packet.
Many thanks to Stefan for his invaluable help !
Fixes: 75c119afe14f ("tcp: implement rb-tree based retransmit queue")
Link: https://lore.kernel.org/netdev/7f31ddc8-9971-495e-a1f6-819df542e0af@gmx.net/
Reported-by: Stefan Wahren <wahrenst@gmx.net>
Tested-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Link: https://lore.kernel.org/r/20231017124526.4060202-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp_output.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2220,6 +2220,18 @@ static int tcp_mtu_probe(struct sock *sk
return -1;
}
+static bool tcp_rtx_queue_empty_or_single_skb(const struct sock *sk)
+{
+ const struct rb_node *node = sk->tcp_rtx_queue.rb_node;
+
+ /* No skb in the rtx queue. */
+ if (!node)
+ return true;
+
+ /* Only one skb in rtx queue. */
+ return !node->rb_left && !node->rb_right;
+}
+
/* TCP Small Queues :
* Control number of packets in qdisc/devices to two packets / or ~1 ms.
* (These limits are doubled for retransmits)
@@ -2242,12 +2254,12 @@ static bool tcp_small_queue_check(struct
limit <<= factor;
if (refcount_read(&sk->sk_wmem_alloc) > limit) {
- /* Always send skb if rtx queue is empty.
+ /* Always send skb if rtx queue is empty or has one skb.
* No need to wait for TX completion to call us back,
* after softirq/tasklet schedule.
* This helps when TX completions are delayed too much.
*/
- if (tcp_rtx_queue_empty(sk))
+ if (tcp_rtx_queue_empty_or_single_skb(sk))
return false;
set_bit(TSQ_THROTTLED, &sk->sk_tsq_flags);
next prev parent reply other threads:[~2023-10-23 11:16 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 10:55 [PATCH 4.19 00/98] 4.19.297-rc1 review Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 01/98] indirect call wrappers: helpers to speed-up indirect calls of builtin Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 02/98] net: use indirect calls helpers at the socket layer Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 03/98] net: fix kernel-doc warnings for socket.c Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 04/98] net: prevent rewrite of msg_name in sock_sendmsg() Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 05/98] RDMA/cxgb4: Check skb value for failure to allocate Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 06/98] platform/x86: hp-wmi:: Mark driver struct with __refdata to prevent section mismatch warning Greg Kroah-Hartman
2023-10-23 16:40 ` Uwe Kleine-König
2023-10-24 7:50 ` Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 07/98] HID: logitech-hidpp: Fix kernel crash on receiver USB disconnect Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 08/98] quota: Fix slow quotaoff Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 09/98] net: prevent address rewrite in kernel_bind() Greg Kroah-Hartman
2023-10-23 10:55 ` [PATCH 4.19 10/98] drm: etvnaviv: fix bad backport leading to warning Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 11/98] drm/msm/dsi: skip the wait for video mode done if not applicable Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 12/98] ieee802154: ca8210: Fix a potential UAF in ca8210_probe Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 13/98] xen-netback: use default TX queue size for vifs Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 14/98] drm/vmwgfx: fix typo of sizeof argument Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 15/98] ixgbe: fix crash with empty VF macvlan list Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 16/98] net: nfc: fix races in nfc_llcp_sock_get() and nfc_llcp_sock_get_sn() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 17/98] nfc: nci: assert requested protocol is valid Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 18/98] workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 19/98] sched,idle,rcu: Push rcu_idle deeper into the idle path Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 20/98] dmaengine: stm32-mdma: abort resume if no ongoing transfer Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 21/98] usb: xhci: xhci-ring: Use sysdev for mapping bounce buffer Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 22/98] net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 23/98] usb: dwc3: Soft reset phy on probe for host Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 24/98] usb: musb: Get the musb_qh poniter after musb_giveback Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 25/98] usb: musb: Modify the "HWVers" register address Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 26/98] iio: pressure: bmp280: Fix NULL pointer exception Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 27/98] iio: pressure: ms5611: ms5611_prom_is_valid false negative bug Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 28/98] mcb: remove is_added flag from mcb_device struct Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 29/98] ceph: fix incorrect revoked caps assert in ceph_fill_file_size() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 30/98] Input: powermate - fix use-after-free in powermate_config_complete Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 31/98] Input: psmouse - fix fast_reconnect function for PS/2 mode Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 32/98] Input: xpad - add PXN V900 support Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 33/98] cgroup: Remove duplicates in cgroup v1 tasks file Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 34/98] pinctrl: avoid unsafe code pattern in find_pinctrl() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 35/98] x86/cpu: Fix AMD erratum #1485 on Zen4-based CPUs Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 36/98] usb: gadget: udc-xilinx: replace memcpy with memcpy_toio Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 37/98] usb: gadget: ncm: Handle decoding of multiple NTBs in unwrap call Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 38/98] powerpc/64e: Fix wrong test in __ptep_test_and_clear_young() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 39/98] x86/alternatives: Disable KASAN in apply_alternatives() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 40/98] dev_forward_skb: do not scrub skb mark within the same name space Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 41/98] usb: hub: Guard against accesses to uninitialized BOS descriptors Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 42/98] Bluetooth: hci_event: Ignore NULL link key Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 43/98] Bluetooth: Reject connection with the device which has same BD_ADDR Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 44/98] Bluetooth: Fix a refcnt underflow problem for hci_conn Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 45/98] Bluetooth: vhci: Fix race when opening vhci device Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 46/98] Bluetooth: hci_event: Fix coding style Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 47/98] Bluetooth: avoid memcmp() out of bounds warning Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 48/98] nfc: nci: fix possible NULL pointer dereference in send_acknowledge() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 49/98] regmap: fix NULL deref on lookup Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 50/98] KVM: x86: Mask LVTPC when handling a PMI Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 51/98] netfilter: nft_payload: fix wrong mac header matching Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 52/98] xfrm: fix a data-race in xfrm_gen_index() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 53/98] xfrm: interface: use DEV_STATS_INC() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 54/98] net: ipv4: fix return value check in esp_remove_trailer Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 55/98] net: ipv6: " Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 56/98] net: rfkill: gpio: prevent value glitch during probe Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 57/98] tcp: fix excessive TLP and RACK timeouts from HZ rounding Greg Kroah-Hartman
2023-10-23 10:56 ` Greg Kroah-Hartman [this message]
2023-10-23 10:56 ` [PATCH 4.19 59/98] net: usb: smsc95xx: Fix an error code in smsc95xx_reset() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 60/98] i40e: prevent crash on probe if hw registers have invalid values Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 61/98] net/sched: sch_hfsc: upgrade rt to sc when it becomes a inner curve Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 62/98] netfilter: nft_set_rbtree: .deactivate fails if element has expired Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 63/98] net: pktgen: Fix interface flags printing Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 64/98] libceph: fix unaligned accesses in ceph_entity_addr handling Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 65/98] libceph: use kernel_connect() Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 66/98] ARM: dts: ti: omap: Fix noisy serial with overrun-throttle-ms for mapphone Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 67/98] btrfs: return -EUCLEAN for delayed tree ref with a ref count not equals to 1 Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 68/98] btrfs: initialize start_slot in btrfs_log_prealloc_extents Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 69/98] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Greg Kroah-Hartman
2023-10-23 10:56 ` [PATCH 4.19 70/98] overlayfs: set ctime when setting mtime and atime Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 71/98] gpio: timberdale: Fix potential deadlock on &tgpio->lock Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 72/98] ata: libata-eh: Fix compilation warning in ata_eh_link_report() Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 73/98] tracing: relax trace_event_eval_update() execution with cond_resched() Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 74/98] HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 75/98] Bluetooth: Avoid redundant authentication Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 76/98] Bluetooth: hci_core: Fix build warnings Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 77/98] wifi: mac80211: allow transmitting EAPOL frames with tainted key Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 78/98] wifi: cfg80211: avoid leaking stack data into trace Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 79/98] sky2: Make sure there is at least one frag_addr available Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 80/98] drm: panel-orientation-quirks: Add quirk for One Mix 2S Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 81/98] btrfs: fix some -Wmaybe-uninitialized warnings in ioctl.c Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 82/98] Bluetooth: hci_event: Fix using memcmp when comparing keys Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 83/98] mtd: rawnand: qcom: Unmap the right resource upon probe failure Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 84/98] mtd: spinand: micron: correct bitmask for ecc status Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 85/98] mmc: core: Capture correct oemid-bits for eMMC cards Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 86/98] Revert "pinctrl: avoid unsafe code pattern in find_pinctrl()" Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 87/98] ACPI: irq: Fix incorrect return value in acpi_register_gsi() Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 88/98] USB: serial: option: add Telit LE910C4-WWX 0x1035 composition Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 89/98] USB: serial: option: add entry for Sierra EM9191 with new firmware Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 90/98] USB: serial: option: add Fibocom to DELL custom modem FM101R-GL Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 91/98] perf: Disallow mis-matched inherited group reads Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 92/98] s390/pci: fix iommu bitmap allocation Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 93/98] gpio: vf610: set value before the direction to avoid a glitch Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 94/98] ASoC: pxa: fix a memory leak in probe() Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 95/98] phy: mapphone-mdm6600: Fix runtime PM for remove Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 96/98] Bluetooth: hci_sock: fix slab oob read in create_monitor_event Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 97/98] Bluetooth: hci_sock: Correctly bounds check and pad HCI_MON_NEW_INDEX name Greg Kroah-Hartman
2023-10-23 10:57 ` [PATCH 4.19 98/98] xfrm6: fix inet6_dev refcount underflow problem Greg Kroah-Hartman
2023-10-23 20:42 ` [PATCH 4.19 00/98] 4.19.297-rc1 review Pavel Machek
2023-10-24 8:34 ` Daniel Díaz
2023-10-24 8:58 ` Sudip Mukherjee (Codethink)
2023-10-24 18:11 ` Guenter Roeck
2023-10-25 18:57 ` Jon Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231023104815.661613824@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=ncardwell@google.com \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox