Disk blocks for long periods
David Woodhouse
dwmw2 at infradead.org
Thu Aug 8 04:02:51 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.
> 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.
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.
--
dwmw2
More information about the linux-mtd
mailing list