Re: Poor RNG performance on Ryzen

2017-07-21 Thread Oliver Mangold
On 21.07.2017 16:47, Theodore Ts'o wrote: On Fri, Jul 21, 2017 at 01:39:13PM +0200, Oliver Mangold wrote: Better, but obviously there is still much room for improvement by reducing the number of calls to RDRAND. Hmm, is there some way we can easily tell we are running on Ryzen? Or

Re: Poor RNG performance on Ryzen

2017-07-21 Thread Oliver Mangold
On 21.07.2017 11:26, Jan Glauber wrote: Nice catch. How much does the performance improve on Ryzen when you use arch_get_random_int()? Okay, now I have some results for you: On Ryzen 1800X (using arch_get_random_int()): --- # dd if=/dev/urandom of=/dev/null bs=1M status=progress 8751415296 b

Poor RNG performance on Ryzen

2017-07-21 Thread Oliver Mangold
Hi, I was wondering why reading from /dev/urandom is much slower on Ryzen than on Intel, and did some analysis. It turns out that the RDRAND instruction is at fault, which takes much longer on AMD. if I read this correctly: --- drivers/char/random.c --- 862 spin_lock_irqsave(&crn