diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-09-15 23:58:38 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-09-16 00:16:17 +0200 |
commit | 4f739cddb9f37b9780c9b0f4d1222b0be8d7e723 (patch) | |
tree | eb9f568c5c2e4345c852721adc49daa96eb12305 /src/device.h | |
parent | data: switch to multiconsumer model with spinlocks (diff) | |
download | wireguard-monolithic-historical-4f739cddb9f37b9780c9b0f4d1222b0be8d7e723.tar.xz wireguard-monolithic-historical-4f739cddb9f37b9780c9b0f4d1222b0be8d7e723.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/device.h')
-rw-r--r-- | src/device.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/device.h b/src/device.h index c71b251..a0960ad 100644 --- a/src/device.h +++ b/src/device.h @@ -23,7 +23,7 @@ struct multicore_worker { struct crypt_queue { spinlock_t lock; - struct list_head queue; + struct list_head list, *head, *tail; union { struct { struct multicore_worker __percpu *worker; @@ -31,7 +31,7 @@ struct crypt_queue { }; struct work_struct work; }; - int len; + atomic_t len; }; struct wireguard_device { |