diff options
author | Eric Dumazet <edumazet@google.com> | 2015-03-22 13:22:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-23 16:52:26 -0400 |
commit | b282705336e03fc7b9377a278939594870a40f96 (patch) | |
tree | fbb9b0bf127fb3910e65b6ff6566fc12396385e4 /net/ipv6/inet6_connection_sock.c | |
parent | 8b929ab12fb2ab960adb3c3ec8d107fef5ff3243 (diff) |
net: convert syn_wait_lock to a spinlock
This is a low hanging fruit, as we'll get rid of syn_wait_lock eventually.
We hold syn_wait_lock for such small sections, that it makes no sense to use
a read/write lock. A spin lock is simply faster.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/inet6_connection_sock.c')
-rw-r--r-- | net/ipv6/inet6_connection_sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 2f3bbe569e8f..6927f3fb5597 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
@@ -124,7 +124,7 @@ struct request_sock *inet6_csk_search_req(struct sock *sk, | |||
124 | u32 hash = inet6_synq_hash(raddr, rport, lopt->hash_rnd, | 124 | u32 hash = inet6_synq_hash(raddr, rport, lopt->hash_rnd, |
125 | lopt->nr_table_entries); | 125 | lopt->nr_table_entries); |
126 | 126 | ||
127 | write_lock(&icsk->icsk_accept_queue.syn_wait_lock); | 127 | spin_lock(&icsk->icsk_accept_queue.syn_wait_lock); |
128 | for (req = lopt->syn_table[hash]; req != NULL; req = req->dl_next) { | 128 | for (req = lopt->syn_table[hash]; req != NULL; req = req->dl_next) { |
129 | const struct inet_request_sock *ireq = inet_rsk(req); | 129 | const struct inet_request_sock *ireq = inet_rsk(req); |
130 | 130 | ||
@@ -138,7 +138,7 @@ struct request_sock *inet6_csk_search_req(struct sock *sk, | |||
138 | break; | 138 | break; |
139 | } | 139 | } |
140 | } | 140 | } |
141 | write_unlock(&icsk->icsk_accept_queue.syn_wait_lock); | 141 | spin_unlock(&icsk->icsk_accept_queue.syn_wait_lock); |
142 | 142 | ||
143 | return req; | 143 | return req; |
144 | } | 144 | } |