From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
"David S. Miller" <davem@davemloft.net>
Subject: [13/68] tcp: Prevent overzealous packetization by SWS logic.
Date: Fri, 24 Sep 2010 09:31:37 -0700 [thread overview]
Message-ID: <20100924163345.161283548@clark.site> (raw)
In-Reply-To: <20100924163357.GA15741@kroah.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]
2.6.32-stable review patch. If anyone has any objections, please let us know.
------------------
From: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
[ Upstream commit 01f83d69844d307be2aa6fea88b0e8fe5cbdb2f4 ]
If peer uses tiny MSS (say, 75 bytes) and similarly tiny advertised
window, the SWS logic will packetize to half the MSS unnecessarily.
This causes problems with some embedded devices.
However for large MSS devices we do want to half-MSS packetize
otherwise we never get enough packets into the pipe for things
like fast retransmit and recovery to work.
Be careful also to handle the case where MSS > window, otherwise
we'll never send until the probe timer.
Reported-by: ツ Leandro Melo de Sales <leandroal@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/net/tcp.h | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -511,8 +511,22 @@ extern unsigned int tcp_current_mss(stru
/* Bound MSS / TSO packet size with the half of the window */
static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
{
- if (tp->max_window && pktsize > (tp->max_window >> 1))
- return max(tp->max_window >> 1, 68U - tp->tcp_header_len);
+ int cutoff;
+
+ /* When peer uses tiny windows, there is no use in packetizing
+ * to sub-MSS pieces for the sake of SWS or making sure there
+ * are enough packets in the pipe for fast recovery.
+ *
+ * On the other hand, for extremely large MSS devices, handling
+ * smaller than MSS windows in this way does make sense.
+ */
+ if (tp->max_window >= 512)
+ cutoff = (tp->max_window >> 1);
+ else
+ cutoff = tp->max_window;
+
+ if (cutoff && pktsize > cutoff)
+ return max_t(int, cutoff, 68U - tp->tcp_header_len);
else
return pktsize;
}
next prev parent reply other threads:[~2010-09-24 16:35 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-24 16:33 [00/68] 2.6.32.23 stable review Greg KH
2010-09-24 16:31 ` [01/68] USB: serial/mos*: prevent reading uninitialized stack memory Greg KH
2010-09-24 16:31 ` [02/68] sparc: Provide io{read,write}{16,32}be() Greg KH
2010-09-24 16:31 ` [03/68] gro: fix different skb headrooms Greg KH
2010-09-24 16:31 ` [04/68] gro: Re-fix " Greg KH
2010-09-24 16:31 ` [05/68] irda: Correctly clean up self->ias_obj on irda_bind() failure Greg KH
2010-09-24 16:31 ` [06/68] tcp: select(writefds) dont hang up when a peer close connection Greg KH
2010-09-24 16:31 ` [07/68] tcp: Combat per-cpu skew in orphan tests Greg KH
2010-09-24 16:31 ` [08/68] tcp: fix three tcp sysctls tuning Greg KH
2010-09-24 16:31 ` [09/68] bridge: Clear IPCB before possible entry into IP stack Greg KH
2010-09-24 16:31 ` [10/68] bridge: Clear INET control block of SKBs passed into ip_fragment() Greg KH
2010-09-24 16:31 ` [11/68] net: Fix oops from tcp_collapse() when using splice() Greg KH
2010-09-24 16:31 ` [12/68] rds: fix a leak of kernel memory Greg KH
2010-10-01 0:50 ` David Miller
2010-09-24 16:31 ` Greg KH [this message]
2010-09-24 16:31 ` [14/68] UNIX: Do not loop forever at unix_autobind() Greg KH
2010-09-24 16:31 ` [15/68] r8169: fix random mdio_write failures Greg KH
2010-09-24 16:31 ` [16/68] r8169: fix mdio_read and update mdio_write according to hw specs Greg KH
2010-09-24 16:31 ` [17/68] sparc64: Get rid of indirect p1275 PROM call buffer Greg KH
2010-09-24 16:31 ` [18/68] drivers/net/usb/hso.c: prevent reading uninitialized memory Greg KH
2010-09-24 16:31 ` [19/68] drivers/net/cxgb3/cxgb3_main.c: prevent reading uninitialized stack memory Greg KH
2010-09-24 16:31 ` [20/68] drivers/net/eql.c: " Greg KH
2010-09-24 16:31 ` [21/68] bonding: correctly process non-linear skbs Greg KH
2010-09-24 16:31 ` [22/68] Staging: vt6655: fix buffer overflow Greg KH
2010-09-24 16:31 ` [23/68] net/llc: make opt unsigned in llc_ui_setsockopt() Greg KH
2010-09-24 16:31 ` [24/68] pid: make setpgid() system call use RCU read-side critical section Greg KH
2010-09-24 16:31 ` [25/68] sched: Fix user time incorrectly accounted as system time on 32-bit Greg KH
2010-09-24 16:31 ` [26/68] oprofile: Add Support for Intel CPU Family 6 / Model 22 (Intel Celeron 540) Greg KH
2010-09-24 16:31 ` [27/68] char: Mark /dev/zero and /dev/kmem as not capable of writeback Greg KH
2010-09-24 16:31 ` [28/68] drivers/pci/intel-iommu.c: fix build with older gccs Greg KH
2010-09-24 16:31 ` [29/68] drivers/video/sis/sis_main.c: prevent reading uninitialized stack memory Greg KH
2010-09-24 16:31 ` [30/68] percpu: fix pcpu_last_unit_cpu Greg KH
2010-09-24 16:31 ` [31/68] aio: check for multiplication overflow in do_io_submit Greg KH
2010-09-24 16:31 ` [32/68] inotify: send IN_UNMOUNT events Greg KH
2010-09-24 16:31 ` [33/68] SCSI: mptsas: fix hangs caused by ATA pass-through Greg KH
2010-09-24 16:31 ` [34/68] ext4: Fix remaining racy updates of EXT4_I(inode)->i_flags Greg KH
2010-09-24 16:31 ` [35/68] IA64: fix siglock Greg KH
2010-09-24 16:32 ` [36/68] IA64: Optimize ticket spinlocks in fsys_rt_sigprocmask Greg KH
2010-09-24 16:32 ` [37/68] KEYS: Fix RCU no-lock warning in keyctl_session_to_parent() Greg KH
2010-09-24 16:32 ` [38/68] KEYS: Fix bug in keyctl_session_to_parent() if parent has no session keyring Greg KH
2010-09-24 16:32 ` [39/68] xfs: prevent reading uninitialized stack memory Greg KH
2010-09-24 16:32 ` [40/68] drivers/video/via/ioctl.c: " Greg KH
2010-09-24 16:32 ` [41/68] ACPI: disable _OSI(Windows 2009) on Asus K50IJ Greg KH
2010-09-24 16:32 ` [42/68] bnx2: Fix netpoll crash Greg KH
2010-09-24 16:32 ` [43/68] bnx2: Fix hang during rmmod bnx2 Greg KH
2010-09-24 16:32 ` [44/68] AT91: change dma resource index Greg KH
2010-09-24 16:32 ` [45/68] cxgb3: fix hot plug removal crash Greg KH
2010-09-24 16:32 ` [46/68] mm: page allocator: drain per-cpu lists after direct reclaim allocation fails Greg KH
2010-09-24 16:32 ` [47/68] mm: page allocator: calculate a better estimate of NR_FREE_PAGES when memory is low and kswapd is awake Greg KH
2010-09-24 16:32 ` [48/68] mm: page allocator: update free page counters after pages are placed on the free list Greg KH
2010-09-24 16:32 ` [49/68] guard page for stacks that grow upwards Greg KH
2010-09-24 16:32 ` [50/68] Fix unprotected access to task credentials in waitid() Greg KH
2010-09-24 16:32 ` [51/68] sctp: Do not reset the packet during sctp_packet_config() Greg KH
2010-09-24 16:32 ` [52/68] 3c503: Fix IRQ probing Greg KH
2010-09-24 16:32 ` [53/68] asix: fix setting mac address for AX88772 Greg KH
2010-09-24 16:32 ` [54/68] [S390] dasd: use correct label location for diag fba disks Greg KH
2010-09-24 16:32 ` [55/68] [PATCH] clocksource: sh_tmu: compute mult and shift before registration Greg KH
2010-09-24 16:32 ` [56/68] gro: Fix bogus gso_size on the first fraglist entry Greg KH
2010-09-24 16:32 ` [57/68] hostap_pci: set dev->base_addr during probe Greg KH
2010-09-24 16:32 ` [58/68] [PATCH] inotify: fix inotify oneshot support Greg KH
2010-09-24 16:32 ` [59/68] Input: add compat support for sysfs and /proc capabilities output Greg KH
2010-09-24 16:32 ` [60/68] MIPS: Quit using undefined behavior of ADDU in 64-bit atomic operations Greg KH
2010-09-24 16:32 ` [61/68] MIPS: Set io_map_base for several PCI bridges lacking it Greg KH
2010-09-24 16:32 ` [62/68] [PATCH] MIPS: uasm: Add OR instruction Greg KH
2010-09-24 16:32 ` [63/68] pata_pdc202xx_old: fix UDMA mode for Promise UDMA33 cards Greg KH
2010-09-24 16:32 ` [64/68] [PATCH] pata_pdc202xx_old: fix UDMA mode for PDC2026x chipsets Greg KH
2010-09-24 16:32 ` [65/68] MIPS: Sibyte: Fix M3 TLB exception handler workaround Greg KH
2010-09-24 16:32 ` [66/68] sis-agp: Remove SIS 760, handled by amd64-agp Greg KH
2010-09-24 16:32 ` [67/68] alpha: Fix printk format errors Greg KH
2010-09-24 16:32 ` [68/68] x86: Add memory modify constraints to xchg() and cmpxchg() Greg KH
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=20100924163345.161283548@clark.site \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable-review@kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
/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