]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: change tcp_skb_pcount() location
authorEric Dumazet <edumazet@google.com>
Wed, 24 Sep 2014 11:11:22 +0000 (04:11 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Sep 2014 20:36:48 +0000 (16:36 -0400)
commitb57dc3891b02e13361b79101edc576a7cc1d7ba4
tree4057e715ca8227a081db71f1ec1359011c5c1a00
parent304422d63ba9c17c0c15149216f682d7f0d13506
tcp: change tcp_skb_pcount() location

Our goal is to access no more than one cache line access per skb in
a write or receive queue when doing the various walks.

After recent TCP_SKB_CB() reorganizations, it is almost done.

Last part is tcp_skb_pcount() which currently uses
skb_shinfo(skb)->gso_segs, which is a terrible choice, because it needs
3 cache lines in current kernel (skb->head, skb->end, and
shinfo->gso_segs are all in 3 different cache lines, far from skb->cb)

This very simple patch reuses space currently taken by tcp_tw_isn
only in input path, as tcp_skb_pcount is only needed for skb stored in
write queue.

This considerably speeds up tcp_ack(), granted we avoid shinfo->tx_flags
to get SKBTX_ACK_TSTAMP, which seems possible.

This also speeds up all sack processing in general.

This speeds up tcp_sendmsg() because it no longer has to access/dirty
shinfo.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp.h
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c