Re: [PATCH] UBI: add minimal amount of reserved erase blocks inKconfig

From: Shmulik Ladkani
Date: Thu Jun 28 2012 - 13:53:14 EST


On Mon, 25 Jun 2012 17:08:38 +0200 Richard Genoud <richard.genoud@xxxxxxxxx> wrote:
> diff --git a/drivers/mtd/ubi/misc.c b/drivers/mtd/ubi/misc.c
> index f6a7d7a..c2c6db0 100644
> --- a/drivers/mtd/ubi/misc.c
> +++ b/drivers/mtd/ubi/misc.c
> @@ -100,8 +100,9 @@ void ubi_calculate_reserved(struct ubi_device *ubi)
> {
> ubi->beb_rsvd_level = ubi->good_peb_count/100;
> ubi->beb_rsvd_level *= CONFIG_MTD_UBI_BEB_RESERVE;

BTW Artem, I've always had an unresolved issue with this original
calculation... maybe you can shed some light here.

Why 'beb_rsvd_level' is set to RESERVE percent of the 'good_peb_count'?

As the device gets worn, number of 'good_peb_count' will lessen over
time - and as such, the 'beb_rsvd_level' may vary (lessen) over time.

I'd expect a fixed number of 'beb_rsvd_level' PEBs for a given mtd
partition, or more correctly, as Richard suggests, the *sum* of bad PEBs
plus the beb reserved PEBs should be constant for a partition - as I
do not expect more than a known constant of blocks to go bad during
device's (and thus, partition's) lifetime.

Regards,
Shmulik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/