High CPU usage when copying files to USB mass storage device

Patrick O'Callaghan pocallaghan at gmail.com
Wed Jul 6 02:51:59 UTC 2011


On Tue, 2011-07-05 at 22:09 +0200, Reindl Harald wrote:
> Am 05.07.2011 18:14, schrieb Patrick O'Callaghan:
> > Flash drives can become slow because of their internal 
> > architecture, fragmentation, wear leveling etc.
> 
> flash drive and fragmentation?
> jokingly?

No, not joking, though fragmentation is probably the wrong term. What I
meant was that flash drives work in fixed-size units which a) are
usually not the same as the filesystem allocation size, and b) must be
erased before being written on, i.e. writing one byte costs almost the
same as writing a full unit (in fact it could conceivably cost more
because in the one-byte case the rest of the unit has to be read first).
If a file is not aligned with these units then more of them than
necessary will need to be read, erased and rewritten, slowing the
process down. One could probably design a pathological worst case that
takes twice as long as the best case.

poc



More information about the users mailing list