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

Re: mkfs.jffs2 throws away my erase size




gleixner@xxxxxxx.de said:
> That's right, but this small erasesizes give a lot of overhead in
> padding of  blocks and garbage collection. So we use 64KB erase size
> in JFFS2 and erase  8 Blocks at once ,if  the chip has 8K erase size. 

Yep. The problem is that we must never write nodes which cross block 
boundaries - so 8KiB blocks mean that we end up writing lots of pages out 
which are _split_ between two erase blocks, hence wasting lots of space on 
extra node headers and less efficient compression. 

If during garbage collection you go from a state where all your nodes 
fitted perfectly into the end of the block to a state where _every_ block 
has a split node at the end of it, then even ignoring compression you 
effectively lose <nrblocks> * hdrsize during that GC pass.

So far, the overly cautious five erase blocks that we keep spare for GC has 
been enough to cover that. But the amount of space should actually be a 
block or two + <nrblocks>  * (hdrsize + <space lost to compression>, and by 
keeping <nrblocks> low I'm trying to avoid having to think too hard about 
that for a little while longer.



--
dwmw2



To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com