diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-16 02:23:42 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-16 04:40:16 +0200 |
commit | f8b57d580aeec5ffd5a23eba1ad626e9614e70a4 (patch) | |
tree | fb0dca3d99575a4768c9833a00908e330864b277 /src/send.c | |
parent | queueing: remove useless spinlocks on sc (diff) | |
download | wireguard-monolithic-historical-f8b57d580aeec5ffd5a23eba1ad626e9614e70a4.tar.xz wireguard-monolithic-historical-f8b57d580aeec5ffd5a23eba1ad626e9614e70a4.zip |
queueing: re-enable preemption periodically to lower latency
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -256,6 +256,12 @@ void packet_encrypt_worker(struct work_struct *work) } } queue_enqueue_per_peer(&PACKET_PEER(first)->tx_queue, first, state); + + /* Don't totally kill scheduling latency by keeping preemption disabled forever. */ + if (have_simd && need_resched()) { + chacha20poly1305_deinit_simd(have_simd); + have_simd = chacha20poly1305_init_simd(); + } } chacha20poly1305_deinit_simd(have_simd); } |