linux/net
Ilpo Järvinen 68f8353b48 [TCP]: Rewrite SACK block processing & sack_recv_cache use
Key points of this patch are:

  - In case new SACK information is advance only type, no skb
    processing below previously discovered highest point is done
  - Optimize cases below highest point too since there's no need
    to always go up to highest point (which is very likely still
    present in that SACK), this is not entirely true though
    because I'm dropping the fastpath_skb_hint which could
    previously optimize those cases even better. Whether that's
    significant, I'm not too sure.

Currently it will provide skipping by walking. Combined with
RB-tree, all skipping would become fast too regardless of window
size (can be done incrementally later).

Previously a number of cases in TCP SACK processing fails to
take advantage of costly stored information in sack_recv_cache,
most importantly, expected events such as cumulative ACK and new
hole ACKs. Processing on such ACKs result in rather long walks
building up latencies (which easily gets nasty when window is
huge). Those latencies are often completely unnecessary
compared with the amount of _new_ information received, usually
for cumulative ACK there's no new information at all, yet TCP
walks whole queue unnecessary potentially taking a number of
costly cache misses on the way, etc.!

Since the inclusion of highest_sack, there's a lot information
that is very likely redundant (SACK fastpath hint stuff,
fackets_out, highest_sack), though there's no ultimate guarantee
that they'll remain the same whole the time (in all unearthly
scenarios). Take advantage of this knowledge here and drop
fastpath hint and use direct access to highest SACKed skb as
a replacement.

Effectively "special cased" fastpath is dropped. This change
adds some complexity to introduce better coveraged "fastpath",
though the added complexity should make TCP behave more cache
friendly.

The current ACK's SACK blocks are compared against each cached
block individially and only ranges that are new are then scanned
by the high constant walk. For other parts of write queue, even
when in previously known part of the SACK blocks, a faster skip
function is used (if necessary at all). In addition, whenever
possible, TCP fast-forwards to highest_sack skb that was made
available by an earlier patch. In typical case, no other things
but this fast-forward and mandatory markings after that occur
making the access pattern quite similar to the former fastpath
"special case".

DSACKs are special case that must always be walked.

The local to recv_sack_cache copying could be more intelligent
w.r.t DSACKs which are likely to be there only once but that
is left to a separate patch.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 14:54:07 -08:00
..
9p 9p: add missing end-of-options record for trans_fd 2007-11-06 08:02:53 -06:00
802 [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
8021q [VLAN]: nested VLAN: fix lockdep's recursive locking warning 2008-01-10 22:38:31 -08:00
appletalk [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
atm [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
ax25 [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
bluetooth [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
bridge [NETFILTER]: Introduce NF_INET_ hook values 2008-01-28 14:53:55 -08:00
core [NET]: Move sock_valbool_flag to socket.c 2008-01-28 14:54:00 -08:00
dccp [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
decnet [NET]: Eliminate duplicate copies of dst_discard 2008-01-28 14:53:37 -08:00
econet [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
ethernet [NET]: Validate device addr prior to interface-up 2007-10-23 21:27:50 -07:00
ieee80211 [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
ipv4 [TCP]: Rewrite SACK block processing & sack_recv_cache use 2008-01-28 14:54:07 -08:00
ipv6 [IPV6] ADDRCONF: Support RFC3484 configurable address selection policy table. 2008-01-28 14:53:58 -08:00
ipx [IPX]: Use existing sock refcnt debugging infrastructure 2007-11-10 21:39:26 -08:00
irda [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
iucv [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
key [AF_KEY]: Fix skb leak on pfkey_send_migrate() error 2008-01-20 20:31:45 -08:00
lapb [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
llc [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
mac80211 [NET]: Move Qdisc_class_ops and Qdisc_ops in appropriate sections. 2008-01-28 14:53:58 -08:00
netfilter [NETFILTER]: Introduce NF_INET_ hook values 2008-01-28 14:53:55 -08:00
netlabel [NETLABEL]: Spelling fixes 2007-12-20 14:03:11 -08:00
netlink [NET]: Move unneeded data to initdata section. 2007-11-13 03:23:50 -08:00
netrom [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
packet [AF_PACKET]: Fix minor code duplication 2007-11-12 21:05:20 -08:00
rfkill rfkill: call rfkill_led_trigger_unregister() on error 2008-01-20 20:31:36 -08:00
rose [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
rxrpc [AF_RXRPC]: Add a missing goto 2007-12-07 04:31:47 -08:00
sched [NET]: Move Qdisc_class_ops and Qdisc_ops in appropriate sections. 2008-01-28 14:53:58 -08:00
sctp [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
sunrpc [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
tipc [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
unix [UNIX]: EOF on non-blocking SOCK_SEQPACKET 2007-11-29 23:19:23 +11:00
wanrouter [NET]: Make /proc/net per network namespace 2007-10-10 16:49:06 -07:00
wireless [WIRELESS] WEXT: Fix userspace corruption on 64-bit. 2007-11-20 03:29:53 -08:00
x25 [NET]: Convert init_timer into setup_timer 2008-01-28 14:53:35 -08:00
xfrm [IPSEC]: Kill afinfo->nf_post_routing 2008-01-28 14:53:55 -08:00
Kconfig [NET]: Add network namespace clone & unshare support. 2007-10-10 16:52:46 -07:00
Makefile 9p: Reorganization of 9p file system code 2007-07-14 15:13:40 -05:00
TUNABLE
compat.c [NETFILTER]: Introduce NF_INET_ hook values 2008-01-28 14:53:55 -08:00
nonet.c [PATCH] Make most file operations structs in fs/ const 2006-03-28 09:16:06 -08:00
socket.c [NET]: Use sockfd_lookup_light in the rest of the net/socket.c 2008-01-28 14:54:00 -08:00
sysctl_net.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00