summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-11-17 17:47:12 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2022-11-18 02:18:10 +0100
commit9148de3196edcba4045cfe717c8e6819fa5adeaf (patch)
tree93eb0a88b7491abc198c3c51d3352c09e67f4edb /include/linux
parentd7bf7f3b813e3755226bcb5114ad2ac477514ebf (diff)
random: reseed in delayed work rather than on-demand
Currently, we reseed when random bytes are requested, if the current seed is too old. Since random bytes can be requested from all contexts, including hard IRQ, this means sometimes we wind up adding a bit of latency to hard IRQ. This was so much of a problem on s390x that now s390x just doesn't provide its architectural RNG from hard IRQ context, so we miss out in that case. Instead, let's just schedule a persistent delayed work, so that the reseeding and potentially expensive operations will always happen from process context, reducing unexpected latencies from hard IRQ. This also has the nice effect of accumulating a transcript of random inputs over time, since it means that we amass more input values. And it should make future vDSO integration a bit easier. Cc: Harald Freudenberger <freude@linux.ibm.com> Cc: Juergen Christ <jchrist@linux.ibm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions