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:
Eric Dumazet
2015-03-22 10:22:21 -07:00
committed by David S. Miller
szülő 8b929ab12f
commit b282705336
6 fájl változott, egészen pontosan 24 új sor hozzáadva és 29 régi sor törölve

Fájl megtekintése

@@ -124,7 +124,7 @@ struct request_sock *inet6_csk_search_req(struct sock *sk,
u32 hash = inet6_synq_hash(raddr, rport, lopt->hash_rnd,
lopt->nr_table_entries);
write_lock(&icsk->icsk_accept_queue.syn_wait_lock);
spin_lock(&icsk->icsk_accept_queue.syn_wait_lock);
for (req = lopt->syn_table[hash]; req != NULL; req = req->dl_next) {
const struct inet_request_sock *ireq = inet_rsk(req);
@@ -138,7 +138,7 @@ struct request_sock *inet6_csk_search_req(struct sock *sk,
break;
}
}
write_unlock(&icsk->icsk_accept_queue.syn_wait_lock);
spin_unlock(&icsk->icsk_accept_queue.syn_wait_lock);
return req;
}