]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: tcp: set SOCK_USE_WRITE_QUEUE for ip_send_unicast_reply()
authorEric Dumazet <edumazet@google.com>
Fri, 1 Apr 2016 15:52:21 +0000 (08:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Apr 2016 02:11:20 +0000 (22:11 -0400)
commitddcdbd113f0f11c5451afb38816a6b27303bfb5a
tree950186e21f38670eb26eca351a96970a613494ad
parentdf807f921c6316480807021d196f289ffe681ffb
ipv4: tcp: set SOCK_USE_WRITE_QUEUE for ip_send_unicast_reply()

TCP uses per cpu 'sockets' to send some packets :
- RST packets ( tcp_v4_send_reset()) )
- ACK packets for SYN_RECV and TIMEWAIT sockets

By setting SOCK_USE_WRITE_QUEUE flag, we tell sock_wfree()
to not call sk_write_space() since these internal sockets
do not care.

This gives a small performance improvement, merely by allowing
cpu to properly predict the sock_wfree() conditional branch,
and avoiding one atomic operation.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c