[PATCH][JFFS2] Reschedule during scan of partly emptyeraseblock

Nielsen David Marqvar David.Nielsen at frequentis.com
Thu May 29 07:40:04 EDT 2008


On Thu, 2008-05-29 at 11:47 +0200, Artem Bityutskiy wrote:
> > This patch adds rescheduling to the loop that scans an empty area of
> > an eraseblock.
> > + /* check for resched - searching an eraseblock may take several ms */
> > + if ( (ofs & 0x7ff /* for each 2KiB */) == 0)
> > + 	cond_resched();
> > +
> 
> I would rather add cond_resched() to jffs2_fill_scan_buf()
> unconditionally. Conditional cond_resched() really looks bad.

I don't see how adding cond_resched() to jffs2_fill_scan_buf() will
remove the long delay imposed by the while() loop that scans an empty
area of an eraseblock - the loop (placed just after the label
"more_empty:") will scan from ofs until scan_end unless it finds a
non-erased area.
There's an outer while loop around this one and the outer loop 
already contains a cond_resched(), so it's not a new thing that
cond_resched() may be needed during the scan.

If I misunderstood what you wrote, please try again :)


--
Br,
David Marqvar Nielsen



More information about the linux-mtd mailing list