Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rngd: prioritize faster sources of entropy
We have two broad categories of entropy sources in rngd. Fast sources and slow sources. Slow sources (like jitterentropy) provided entropy to systems that have no other entropy source, but can actually hinder performance when large amounts of entropy are requested (consider a case where the entropy pool is empty, and the rdrand source can provide twice the entropy in half the time that jitterentropy can). Its still valuable to have jitterentropy enabled, but we shouldn't be extracting entropy from it, if a faster source can provide it. So lets prioritize our fast sources over the slow ones. in the do_loop, lets by default not collect entropy from sources marked as slow. If we pass through an interation of the do_loop with no entropy collected, then lets include the slow sources on the next pass to give us a better chance at collection. Then, when entropy is gathered, we can go back to only using the fast sources. Signed-off-by: Neil Horman <[email protected]>
- Loading branch information