[Bug 244356] Writing to a USB 3.0 stick is very slow
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sat May 23 10:11:55 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244356
Gary Jennejohn <gljennjohn at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gljennjohn at gmail.com
--- Comment #76 from Gary Jennejohn <gljennjohn at gmail.com> ---
(In reply to Olivier Certner from comment #75)
Flash is complicated. There's SLC (one bit per cell, fast but expensive), MLC
(two bits per cell), TLC (three bits per cell) and QLC (four bits per cell,
high storage density but slow).
The more bits per cell the more complicated it is for the controller to write
data to the flash.
I tested with a 128GB USB3 stick from Medion. Probably not the fastest stick
on the market. I suspect, but can't prove, that this stick uses TLC flash.
I must point out that I was using this stick for backups in a Linux project
with the ext4 filesystem. The stick was pretty full.
I then decided to reformat it with UFS. Note that after formatting there were
still lots of dirty sectors left over from using it for Linux backups.
I mounted the stick and used dd to copy a 3GiB file with bs=128k to the UFS
file system. The average transfer rate was 3.95MiB/s.
I then unmounted the stick to get rid of the file contents in the buffer cache
and remounted it.
Then I used dd with bs=128k to copy the file to /dev/null. The average
transfer rate was 104.6MiB/s.
So, I still suspect that the controller was forced to do lots of bookkeeping to
copy data to the flash.
Since flash is initialized with all 1s when manufactured and setting a 1 to a 0
is easy for the controller, but setting a 0 to a 1 is much more time consuming,
an interesting test would be to fill all sectors with 1s and then do a transfer
test. Unfortunately, there's no /dev/one available, so this would be rather
challenging to do with a high-capacity stick.
There may be a command which can be sent to the controller to erase all sectors
at once (set all bits to 1), but I'm not sure about that.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-usb
mailing list