Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4690 closed bug (fixed)

Writing to USB extremely slow

Reported by: koki Owned by: mmlr
Priority: normal Milestone: R1
Component: Drivers/USB Version: R1/alpha1
Keywords: Cc: imker@…, boobsd@…
Blocked By: Blocking:
Has a Patch: no Platform: All


Using revision 33211, copying files to a USB thumbdrive (0930:6545 "Kingston" "DataTraveler 2.0" ver. 0100) is extremely slow.

The Tracker progress window shows completion of the copy operation very soon, but the thumbdrive LED keeps flashing for a long time, during which it is not possible to unmount the drive (I suppose indicating that copy operation is still taking place).

Here are the approximate times that it took Haiku to actually finish copying:

65MB of video files: 3 minutes 350MB ZIP: 8 minutes

Listdev output attached.

Not sure of the component selection, so feel free to change.

Attachments (1)

listdev (2.3 KB) - added by koki 10 years ago.
Listdev output

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by koki

Attachment: listdev added

Listdev output

comment:1 Changed 10 years ago by siarzhuk

Cc: imker@… added

comment:2 Changed 10 years ago by Boo

Cc: boobsd@… added

comment:3 Changed 10 years ago by mmlr

Read speeds should be reasonable (not optimal though) in hrev33503. I'm preparing a larger rework of page writing to also get write speeds to acceptable levels.

comment:4 Changed 10 years ago by mmlr

Write performance should be considerably better since hrev33507. Due to how the caches allocate pages it is possible though that due to physical page fragmentation performance degrades right down to the worst case scenario it was before. This should only be seen when saturating physical memory, i.e. when transferring large files so that the caches are exhausted. I'm investigating different allocation strategies and other possible optimizations to further optimize this though.

comment:5 Changed 10 years ago by mmlr

Resolution: fixed
Status: newclosed

Both read and write performance should be reasonable on hrev33526 and up. It should also not degrade when running into low page situations anymore. Note that performance is still suboptimal compared to other systems due to various factors, like the fully synchronous transfers we do, the extra mappings we do and also due to how BFS works which isn't optimal for flash media. Still the performance should be OK for everyday usage. USB boot should also be improved quite a bit by those changes.

comment:6 Changed 10 years ago by koki

Results from (informal) testing by copying 450MB worth of video files on hrev33564:

When copying from the USB stick to HDD, files transfer is now much faster.

However, when copying from HDD to the USB stick, the Tracker progress bar flies by in 2-3 seconds, but the thumbdrive still keeps flashing a disproportionately long time (close to 3 minutes).

In contrast, on the same hardware, copying the very same files from HDD to the USB thumbdrive takes only 10-15 seconds in Windows and/or Ubuntu. I am not sure if this is the expected performance for Haiku at this stage, so just mentioning it as a point of reference. Let me know if you want me to provide any other info.

comment:7 Changed 10 years ago by mmlr

That's mostly OK. For one, the speed is limited due to the factors described above, and for the other, there's not much pressure. When there isn't much pressure, the system will gradually write back pages. If you instruct it to actually go forward using "sync" or unmounting/rebooting, it will push the changes through. There's provisions for write-through caches that could be used in this case to constantly flush changes, I'm not sure if that'd defeat some of the cache purpose though.

Note: See TracTickets for help on using tickets.