diff options
author | 2017-09-15 23:58:38 +0200 | |
---|---|---|
committer | 2017-09-16 00:16:17 +0200 | |
commit | 4f739cddb9f37b9780c9b0f4d1222b0be8d7e723 (patch) | |
tree | eb9f568c5c2e4345c852721adc49daa96eb12305 /src/send.c | |
parent | data: switch to multiconsumer model with spinlocks (diff) | |
download | wireguard-monolithic-historical-jd/lockless-queuing.tar.xz wireguard-monolithic-historical-jd/lockless-queuing.zip |
data: move from spinlocks to lockless data structurejd/lockless-queuing
Reference: https://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html
Original-code-from: @aegis
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -111,7 +111,7 @@ void packet_send_keepalive(struct wireguard_peer *peer) struct sk_buff *skb; struct sk_buff_head queue; - if (list_empty(&peer->init_queue.queue)) { + if (!atomic_read(&peer->init_queue.len)) { skb = alloc_skb(DATA_PACKET_HEAD_ROOM + MESSAGE_MINIMUM_LENGTH, GFP_ATOMIC); if (unlikely(!skb)) return; |