sync() takes minutes while erasing

Joakim Tjernlund joakim.tjernlund at transmode.se
Wed Jun 20 12:26:36 EDT 2007


On Wed, 2007-06-20 at 11:09 -0500, Josh Boyer wrote:
> On Wed, 2007-06-20 at 16:49 +0200, Joakim Tjernlund wrote:
> > On Wed, 2007-06-20 at 16:21 +0200, Joakim Tjernlund wrote:
> > > Here we go again :)
> > > 
> > > Noticed one again large delays when rebooting and jffs2 is busy
> > > erasing block via pdflush.
> > > 
> > > Can't see where sync() ends up in jffs2, anyone
> > > know the jffs2(or pdflush) functions involved during a sync?
> > > 
> > >  Jocke 
> > 
> > Ok, found the cause:
> >  jffs2_erase_pending_blocks(c, 0) is called from
> >  jffs2_write_super() and it hangs until all
> >  pending erases are complete.
> > 
> > Why do jffs2_write_super() need to call 
> > jffs2_erase_pending_blocks(c, 0)? Seems like a bad idea to me.
> 
> jffs2_write_super is called during unmount.  If there are blocks pending
> on the erase list, it's better to erase those now before the unmount is
> completed.  Saves some time on the next mount.

No, not if the reboot/unmont is suspended for minutes just because jffs2
wants to finish erasing. It doesn't save you much, if anything, at
remount either.

The erasing in context is just something that needs to be done at some
point but it don't have to happen now.

  Jocke 

> 
> josh
> 
> 
> 



More information about the linux-mtd mailing list