JFFS2 - speed up while booting

Ricard Wanderlof ricard.wanderlof at axis.com
Tue Jan 5 04:23:32 EST 2010


On Tue, 5 Jan 2010, linux newbie wrote:

> Hi,
>
> It is slow during every boot. Seems it is scanning for bad blocks (If
> I enable the debug message. Usually debug is OFF).

During mount, JFFS2 will scan for cleanmarkers in the OOB area of each 
block, indicating that the block has been erased and can be used for 
storage. If cleanmarkers can not be found in blocks that appear to be 
empty (= all FFh), it puts the blocks on the erase queue for subsequent 
erasure. The erase process takes time and during erasure the flash cannot 
be read from which can account for slow booting. However, this should only 
happen the first time after mounting a newly flashed file system. 
Subsequent mounts should detect the cleanmarkers, and no erase will be 
performed. It can take a few minutes to complete the erase procedure 
though; if you do a 'top' on your system you'll see the pdflush task at 
the top while it is in progress, so if you reboot your system several 
times in succession JFFS2 might not have time to complete the erase of all 
unused blocks.

I don't know if this has been addressed recently, but the odd thing is 
that if you for instance implement separate erase sequence for instance in 
your flash driver, the total erase+boot time is much less than if you let 
JFFS2 handle it via the pdflush task.

Another option is to write cleanmarkers to empty blocks while writing your 
file system image. I don't think nandwrite has an option for that though.

But at any rate, you should only see this slowdown after first mount. 
Subsequent mounts should find the cleanmarkers in place and no erasure 
should be necessary. So I'm not convinced this is actually your problem.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list