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>
This commit is contained in:
@@ -728,7 +728,7 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
|
||||
|
||||
entry.family = sk->sk_family;
|
||||
|
||||
read_lock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
|
||||
spin_lock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
|
||||
|
||||
lopt = icsk->icsk_accept_queue.listen_opt;
|
||||
if (!lopt || !listen_sock_qlen(lopt))
|
||||
@@ -776,7 +776,7 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,
|
||||
}
|
||||
|
||||
out:
|
||||
read_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
|
||||
spin_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user