Re: Writing to USB3 memory stick with 4.4 is 52 times slower than Win7 inside virtualbox

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 03, 2016 at 09:05:26PM -0800, Greg Kroah-Hartman wrote:
> > Still, you're likely on the right track, something seems to wait for
> > each write to proceed before sending the next one.
> 
> What are you using to copy files?
 
midnight commander, or straight cp, only copying one big file, seeing
how quickly it's being copied.

> > Is there another option I can try?
> 
> Turning off sync is the key thing here, without that on, things "seem"
> to be faster now.  The real speed is the same, writes for your device

And by faster, it's actually instant as long as the file is smaller than
my amount of free RAM :)

> is slow due to the flash chip, not the USB bandwidth.  I'd try a "real"

True, but it's not that simple. My USB stick actually has a red LED that
flashes when it's working.
When I copy with windows at 20MB/s+, the USB LED stops flashing when
windows says the copy is over, and I can safely eject hardware.

With linux, I tried this:
bash -c 'time cp /var/local/space/vid/300MB* /mnt/mnt; umount /mnt/mnt'
Sadly, it returns 2s for both, meaning that unmount succeeds before the
data is on the stick.

If I watch the flashing LED, the copy takes around 15 seconds. This
means my copy speed under linux was about 73MB/s now, but that's based
on an LED flashing.

> filesystem benchmark tool if you really want to know the speeds it can
> work at (fio is good.)

There are plenty of FS benchmarks, if you have one specific one with
specific options you'd like me to use, I'm happy to.

But really a copy of a 300MB file sequentially is the only test I really
care about and that's trivial to reproduce without more complex
benchmark tools.

If I had to guess, sync causes cp(1) to be very conservative and wait
for a sync after each 4KB block while windows probably blasts all the
data with fewer sync calls in between?
(wild guess at this point)

But the main point remains that default mount options and default cp
work at horrible speed. I'm happy to try stuff to get around that
(nosync might be one, but having my stick write after I unmounted it,
makes me very nervous), so I'd love a solution where cp succeeds when
the data has been synced to flash, and at the very least for unmount not
to return before the data has been committed.

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux