diff options
author | Eric Dumazet <edumazet@google.com> | 2014-09-24 07:11:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-28 16:36:48 -0400 |
commit | cd7d8498c9a5d510c64db38d9f4f4fbc41790f09 (patch) | |
tree | 4057e715ca8227a081db71f1ec1359011c5c1a00 /net/ipv4/tcp.c | |
parent | dc83d4d8f6c897022c974a00769b7a6efee6aed8 (diff) |
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>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 553b01f52f71..87289e51be00 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -963,7 +963,7 @@ new_segment: | |||
963 | skb->ip_summed = CHECKSUM_PARTIAL; | 963 | skb->ip_summed = CHECKSUM_PARTIAL; |
964 | tp->write_seq += copy; | 964 | tp->write_seq += copy; |
965 | TCP_SKB_CB(skb)->end_seq += copy; | 965 | TCP_SKB_CB(skb)->end_seq += copy; |
966 | skb_shinfo(skb)->gso_segs = 0; | 966 | tcp_skb_pcount_set(skb, 0); |
967 | 967 | ||
968 | if (!copied) | 968 | if (!copied) |
969 | TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_PSH; | 969 | TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_PSH; |
@@ -1261,7 +1261,7 @@ new_segment: | |||
1261 | 1261 | ||
1262 | tp->write_seq += copy; | 1262 | tp->write_seq += copy; |
1263 | TCP_SKB_CB(skb)->end_seq += copy; | 1263 | TCP_SKB_CB(skb)->end_seq += copy; |
1264 | skb_shinfo(skb)->gso_segs = 0; | 1264 | tcp_skb_pcount_set(skb, 0); |
1265 | 1265 | ||
1266 | from += copy; | 1266 | from += copy; |
1267 | copied += copy; | 1267 | copied += copy; |