1 (edited by aether 2019-05-24 08:51:36)

Topic: /dev/urandom performance regression with 4.9.176 kernel

Since 4.9.176 kernel update, i'm having huge performance issues when using /dev/urandom (to secure erase a usb key), it happens with USB2 or USB3.
To be more specific, it writes at 5MB/s with a HUGE IO/WAIT (almost 80%) (instead of 30MB/s with USB2, and 80MB/s with USB3 before updating kernel)
At first, I thought my usb device was faulty but on an other machine running Gentoo (with 4.19.44 kernel), the issue is not present.

By the way, it seems to affect only USB flash devices, as using /dev/urandom to erase a SATA disk (connected through SATA port or with SATA to USB adapter still works just fine)

Anyone else having the same issue ? Easy to replicate if you have a usb key laying around. I'm not sure what is causing the issue. With previous kernel, it was working fine.

2

Re: /dev/urandom performance regression with 4.9.176 kernel

I wouldn't mind trying that out. What steps do we do to replicate this?

3 (edited by aether 2019-06-01 11:41:28)

Re: /dev/urandom performance regression with 4.9.176 kernel

Thanks,
With a random USB key (with nothing on it of course..) plugged on USB2 port, try an erase with urandom, like this :

I assume the USB key is on /dev/sdb, make sure it is, triple check. You don't want to erase your main drive right ? smile

dd if=/dev/urandom of=/dev/sdb bs=4096 status=progress

And see if the speed looks normal.

4

Re: /dev/urandom performance regression with 4.9.176 kernel

aether wrote:

Thanks,
With a random USB key (with nothing on it of course..) plugged on USB2 port, try an erase with urandom, like this :

I assume the USB key is on /dev/sdb, make sure it is, triple check. You don't want to erase your main drive right ? smile

dd if=/dev/urandom of=/dev/sdb bs=4096 status=progress

And see if the speed looks normal.

I would advise him also to use the command lsblk to make sure its /dev/sdb...

cannot be too careful, right?

HyperbolaBSD: The Future of Secure Libre Lightweight Operating Systems!

5 (edited by outtasight 2019-06-03 10:51:54)

Re: /dev/urandom performance regression with 4.9.176 kernel

In an effort to be very concise, the following has been severely edited and thus lacks details:

It has been my experience thus far, that Hyperbola kernel versions 4.9.176 and 4.9.155, running on both an Intel and AMD machines, have not had any significant effect on dumping /dev/urandom to an USB stick.

I have observed that while using an USB 2 stick, in both USB 2 and USB 3, neither have any significant impact on the reported speed. The speed does however, start off excellent, approximately 240 MB/s, to which it continuously declines, to approximately 10 MB/s, around six minutes into the test, at which the 4 GB device in question has apparently run out of space.

With a SSD hard drive, however, I didn't experience such incredible speed degradation, starting at about 100 MB/s, occasionally fluctuating between approximately 70 to 90 MB/s, but never apparently going below 70 for any noticeable amount of time.

6

Re: /dev/urandom performance regression with 4.9.176 kernel

Thanks for the report outtasight.
10mb/s seems quite slow but I guess it depends of the usb key. And I think it is always kind of slow when one reach the end of it.
Anyway, I solved it. It was a motherboard "issue". I unplugged the ac cord on my PSU and reset the cmos and now speed are back to "normal" (same as yours roughly) on this motherboard. Maybe the storm last week I don't know.. I use an UPS but I guess something went wrong.