kernel-ark/net/core
Eric Dumazet 46d3ceabd8 tcp: TCP Small Queues
This introduce TSQ (TCP Small Queues)

TSQ goal is to reduce number of TCP packets in xmit queues (qdisc &
device queues), to reduce RTT and cwnd bias, part of the bufferbloat
problem.

sk->sk_wmem_alloc not allowed to grow above a given limit,
allowing no more than ~128KB [1] per tcp socket in qdisc/dev layers at a
given time.

TSO packets are sized/capped to half the limit, so that we have two
TSO packets in flight, allowing better bandwidth use.

As a side effect, setting the limit to 40000 automatically reduces the
standard gso max limit (65536) to 40000/2 : It can help to reduce
latencies of high prio packets, having smaller TSO packets.

This means we divert sock_wfree() to a tcp_wfree() handler, to
queue/send following frames when skb_orphan() [2] is called for the
already queued skbs.

Results on my dev machines (tg3/ixgbe nics) are really impressive,
using standard pfifo_fast, and with or without TSO/GSO.

Without reduction of nominal bandwidth, we have reduction of buffering
per bulk sender :
< 1ms on Gbit (instead of 50ms with TSO)
< 8ms on 100Mbit (instead of 132 ms)

I no longer have 4 MBytes backlogged in qdisc by a single netperf
session, and both side socket autotuning no longer use 4 Mbytes.

As skb destructor cannot restart xmit itself ( as qdisc lock might be
taken at this point ), we delegate the work to a tasklet. We use one
tasklest per cpu for performance reasons.

If tasklet finds a socket owned by the user, it sets TSQ_OWNED flag.
This flag is tested in a new protocol method called from release_sock(),
to eventually send new segments.

[1] New /proc/sys/net/ipv4/tcp_limit_output_bytes tunable
[2] skb_orphan() is usually called at TX completion time,
  but some drivers call it in their start_xmit() handler.
  These drivers should at least use BQL, or else a single TCP
  session can still fill the whole NIC TX ring, since TSQ will
  have no effect.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Dave Taht <dave.taht@bufferbloat.net>
Cc: Tom Herbert <therbert@google.com>
Cc: Matt Mathis <mattmathis@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Nandita Dukkipati <nanditad@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-11 18:12:59 -07:00
..
datagram.c net: skb_free_datagram_locked() doesnt drop all packets 2012-06-27 15:40:57 -07:00
dev_addr_lists.c
dev.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-07-10 23:56:33 -07:00
drop_monitor.c drop_monitor: dont sleep in atomic context 2012-06-04 11:42:01 -04:00
dst.c net: Kill dst->_neighbour, accessors, and final uses. 2012-07-05 02:42:00 -07:00
ethtool.c ethtool: Make more commands available to unprivileged processes 2012-06-12 18:51:09 -07:00
fib_rules.c ipv4: Elide fib_validate_source() completely when possible. 2012-06-29 01:36:36 -07:00
filter.c net/core: fix kernel-doc warnings 2012-06-08 22:20:58 -07:00
flow_dissector.c
flow.c
gen_estimator.c
gen_stats.c
iovec.c
link_watch.c
Makefile
neighbour.c neigh: Convert over to dst_neigh_lookup_skb(). 2012-07-05 01:12:00 -07:00
net_namespace.c net: core: Use pr_<level> 2012-05-17 05:00:04 -04:00
net-sysfs.c wireless: remove wext sysfs 2012-06-05 15:32:15 -04:00
net-sysfs.h
net-traces.c
netevent.c
netpoll.c netpoll: fix netpoll_send_udp() bugs 2012-06-13 15:57:31 -07:00
netprio_cgroup.c net: cgroup: fix out of bounds accesses 2012-07-09 14:50:54 -07:00
pktgen.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-05-20 21:53:04 -04:00
request_sock.c
rtnetlink.c net: Fix (nearly-)kernel-doc comments for various functions 2012-07-10 23:13:45 -07:00
scm.c
secure_seq.c
skbuff.c net: Fix (nearly-)kernel-doc comments for various functions 2012-07-10 23:13:45 -07:00
sock_diag.c netlink: add netlink_kernel_cfg parameter to netlink_kernel_create 2012-06-29 16:46:02 -07:00
sock.c tcp: TCP Small Queues 2012-07-11 18:12:59 -07:00
stream.c
sysctl_net_core.c
timestamping.c
user_dma.c
utils.c