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 | 8186537ff6272a5533e4dcf4b1b428d9328bed44 (patch) | |
tree | 92471a58662137a7122f38fd8ea0c7148dabda42 /src/send.c | |
parent | a63830c6bbbf251765a5caee4111835048665f23 (diff) |
queueing: re-enable preemption periodically to lower latency
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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); } |