aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/device.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-09-15 23:58:38 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-09-16 00:16:17 +0200
commit4f739cddb9f37b9780c9b0f4d1222b0be8d7e723 (patch)
treeeb9f568c5c2e4345c852721adc49daa96eb12305 /src/device.h
parentdata: switch to multiconsumer model with spinlocks (diff)
downloadwireguard-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/device.h')
-rw-r--r--src/device.h4
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 {