aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-09-24 08:16:51 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-05 03:21:54 -0400
commitb3a5b6cc7cab89dcc3301add750f88019d910a2b (patch)
treeb22e79b455ee2c9b3b131ef1dcf9d997a24fe2ce /net
parenta9828ec6bc0b7e19a65f7e13daa8bd35a926a753 (diff)
icmp: No need to call sk_write_space()
We can make icmp messages tx completion callback a litle bit faster. Setting SOCK_USE_WRITE_QUEUE sk flag tells sock_wfree() to not call sk_write_space() on a socket we know no thread is posssibly waiting for write space. (on per cpu kernel internal icmp sockets only) This avoids the sock_def_write_space() call and read_lock(&sk->sk_callback_lock)/read_unlock(&sk->sk_callback_lock) calls as well. We avoid three atomic ops. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/icmp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 5bc13fe816d1..84adb5754c96 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1165,6 +1165,10 @@ static int __net_init icmp_sk_init(struct net *net)
1165 sk->sk_sndbuf = 1165 sk->sk_sndbuf =
1166 (2 * ((64 * 1024) + sizeof(struct sk_buff))); 1166 (2 * ((64 * 1024) + sizeof(struct sk_buff)));
1167 1167
1168 /*
1169 * Speedup sock_wfree()
1170 */
1171 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
1168 inet_sk(sk)->pmtudisc = IP_PMTUDISC_DONT; 1172 inet_sk(sk)->pmtudisc = IP_PMTUDISC_DONT;
1169 } 1173 }
1170 1174