[PATCH] Fix hanging close for /dev/mtd

Joakim Tjernlund joakim.tjernlund at transmode.se
Wed Jun 13 09:25:34 EDT 2007


On Wed, 2007-06-13 at 07:31 -0500, Josh Boyer wrote:
> On Wed, 2007-06-13 at 13:48 +0200, Joakim Tjernlund wrote:
> > On Wed, 2007-06-13 at 06:44 -0500, Josh Boyer wrote:
> > > On Wed, 2007-06-13 at 11:53 +0200, Joakim Tjernlund wrote:
> > > > Figured I should send this on its own.
> > > > 
> > > > Stracing a process using /dev/mtd shows that
> > > > it sometimes hangs for a long time when pdflush is erasing
> > > > sectors. /dev/mtd* close method calls the mtd->sync method
> > > > which can hang for a long time(minutes).
> > > > 
> > > > Futher, the sync method "syncs" all flash chips. It should
> > > > only sync the chips that a /dev/mtd* spans.
> > > > Also, the mtdchar/mtdblock drivers does not need to
> > > > call sync for readonly mappings.
> > > 
> > > So were you going to submit a separate patch for those issues?
> > > 
> > > josh
> > 
> > Wow, someone is reading my mails :)
> 
> Heh, indeed :)
> 
> > Just did for mtdchar, the others are a bit more complex
> > so I won't bother with them.
> 
> Great.  Oh, and I think your JFFS2 patch seems valid.  If I remember
> correctly, David just did another similar s/cond_resched/yield/ change
> that showed significant speed ups in OLPC boot times.

Yes, he did. I think cond_resched idea isn't working as intended
with 2.6. I belive that the scheduler can promote a process/kernel
thread so that the cond_resched()/schedule() becomes a NOP.

  Jocke



More information about the linux-mtd mailing list