On Sunday 04 Sep 2016 17:48:14 Stroller wrote:
> > On 3 Sep 2016, at 17:50, Mick <michaelkintz...@gmail.com> wrote:

> > Yes, flash drives (unlike spinning drivers) are completely digital.  In
> > addition, wear levelling algorithms invariably kick in and bits and bytes
> > are sprayed all over the pages/modules of the memory chips.  So you could
> > say they are fragmented by design.
> 
> That would seem to dismiss the problem, "oh, they're fragmented by design,
> thus it's unimportant".

I'm far from an expert on NOR/NAND flash drives and therefore I didn't mean to 
sound dismissive.  I was merely highlighting the fact that the memory 
controller on these cards interferes with whatever our OS is trying to write 
on them, as the card's chip controller implements various wear levelling 
algorithms.


> My understanding is that defragmenting a flash device (although I think,
> personally, I would only do this by deleting all the files on the drive,
> and copying them back) can make for faster access.
> 
> • http://www.lagom.nl/misc/flash_fragmentation.html
> •
> http://www.wizcode.com/articles/comments/flash_memory_fragmentation_myths_a
> nd_facts/
> 
> Stroller.

Some of these tests assume that flushing the OS cache *also* flushes the cache 
on the flash drive.  This is not so, especially on more modern flush drives.  
I've been watching the behaviour of a Verbatim 32G USB stick I use more or 
less daily and I am convinced that running sync following a copy operation on 
my PC, in no way means the cache on the flash controller is also flushed.

What these tests prove is that when the card is full it takes longer to write 
content on it, because blocks will have to be erased before they can be 
written on.  The cluster size is quite important for this performance, as is 
the size of the file(s) being copied.

What I am saying is that the write operation performance is determined by the 
cluster size, the file size, the flash drive's cache size and most importantly 
by the flash drive controller's wear levelling algorithms.  There is no 
guarantee that data will be written contiguously, although they will be 
written in one-block-at-a-time.  The blocks themselves almost certainly will 
not be contiguous on a used drive.  Formatting it with unsuitable logical 
block sizes for its physical block size will almost certainly incur a write 
penalty (always depending on the size of the file being written).

This is what I meant when I said USB flash drives are fragmented by design.
-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to