Disk blocks for long periods

Joakim Tjernlund joakim.tjernlund at lumentis.se
Thu Aug 8 04:32:40 EDT 2002


> 
> joakim.tjernlund at lumentis.se said:
> >  I noticed that erase_callback() in erase.c useses spin_lock(), not
> > spin_lock_bh(). Should it?
> 
> It expects to actually be called in bottom-half context, and if it isn't 
> then nothing else will be. So it's fine to use spin_lock() there.
OK.
> 
> >  I dont understand what using a timer would give us. I suppose that
> > one could have more the one erase simontainously(one per bank) but
> > that won't give a significant improvement and erase.c must be made
> > "bank aware" as well. 
> 
> > Unless there is some other advantage, I think you should change the
> > spec.
> 
> Using a timer to check for erase completion means that the process which 
> submitted the erase doesn't have to be blocked waiting for it. The callback 
> can happen some time later. In the case of JFFS2, it's kupdated that ends 
> up stuck in the erase routine for ages.

Maybe erasing should be moved away from kupdate then, to the gc thread or a new
erase thread that does not mind beeing blocked?
> 
> But using a timer to actually do the check doesn't mean we have to call the 
> completion callback in timer context -- we could use schedule_task() to run 
> it in process context.

OK, so if schedule_task() is used instead its possible to replace spin_lock_bh
with spin_lock everywhere?

I think we should change erase.c to do atmost 3 erase & mark in one go.
That will free up space more quickly when there is a lot of pending erases.

 Jocke
> 
> --
> dwmw2
> 
> 
> 





More information about the linux-mtd mailing list