Re: Jffs2 and big file = very slow jffs2_garbage_collect_pass

Jörn Engel
2008-01-22T12:09:26Z

On Tue, 22 January 2008 09:57:07 +0100, Matthieu CASTET wrote:
>
> On mtd->read I have see no checking for EBADMSG or EUCLEAN.

Correct. The CRC check will barf when uncorrectable errors are
encountered. Using -EUCLEAN as a trigger to scrub the blocks would be
useful.

> There no call to mtd->block_markbad or mtd->block_isbad (it is only
> called in mtd_find_sb).

Used to be there and was removed. mtd->erase() does the same as
mtd->block_isbad(). Calling both would be redundant and a waste of
time. And logfs has its own bad block table (bad segment table,
actually), so mtd->block_markbad could only be called to play nice with
others after filesystem gets nuked and the flash reused for something
else. Not all devices define that method. For a while I carried a
patch that would add a dummy noop call in add_mtd_device (noop call is
faster than a conditional), but dropped it because it just doesn't
matter enough.

> Good test could be to add bad block simulation to nandsim.
> There is some patch for this
> (http://lists.infradead.org/pipermail/linux-mtd/2006-December/017107.html).
> Note they don't simulate bit-flip on read.

Ramtd can simulate bit-flips as well. A nice test setup needs a bit
more than that, some way to do random, yet repeatable errors.

Jörn

--
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
-- /usr/src/linux/init/main.c