diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-05-06 15:33:04 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-07-07 13:26:42 +0200 |
commit | dbbb182f83c8fdd4456c681cba9c05b3bc4e481e (patch) | |
tree | f7c87cc42bc784c9f9e2c133e482c3caab01e3d0 /drivers/net/wireguard/ratelimiter.h | |
parent | 5800d84de20a7785e6fb8f99cfc9c0643e7887f7 (diff) | |
download | wireguard-linux-trimmed-dbbb182f83c8fdd4456c681cba9c05b3bc4e481e.tar.gz wireguard-linux-trimmed-dbbb182f83c8fdd4456c681cba9c05b3bc4e481e.zip |
wireguard: send/receive: cond_resched() when processing worker ringbuffers
commit 1f65905c9f926f0bf7a98cb7f51ded3a6c2d0a8a upstream.
Users with pathological hardware reported CPU stalls on CONFIG_
PREEMPT_VOLUNTARY=y, because the ringbuffers would stay full, meaning
these workers would never terminate. That turned out not to be okay on
systems without forced preemption, which Sultan observed. This commit
adds a cond_resched() to the bottom of each loop iteration, so that
these workers don't hog the core. Note that we don't need this on the
napi poll worker, since that terminates after its budget is expended.
Suggested-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reported-by: Wang Jian <larkwang@gmail.com>
Fixes: a8f1bc7bdea3 ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'drivers/net/wireguard/ratelimiter.h')
0 files changed, 0 insertions, 0 deletions