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

Artem Bityutskiy dedekind at infradead.org
Thu May 29 07:49:29 EDT 2008


On Thu, 2008-05-29 at 13:40 +0200, Nielsen David Marqvar wrote:
> 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.

Ok, I see. 

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list