public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Cc: Richard Genoud <richard.genoud@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] UBI: add minimal amount of reserved erase blocks in Kconfig
Date: Fri, 29 Jun 2012 15:47:44 +0300	[thread overview]
Message-ID: <1340974064.3070.177.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <20120628205303.676fa2ea@halley>

[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]

On Thu, 2012-06-28 at 20:53 +0300, Shmulik Ladkani wrote:
> On Mon, 25 Jun 2012 17:08:38 +0200 Richard Genoud <richard.genoud@gmail.com> 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'?

I thought it was a good idea I guess :-)

> 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.

Yeah, probably you are right.

> 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.

Those days we did not have this "vendor-guaranteed max. bad blocks
count" thing and I thought that UBI would try to always maintain a pool
of reserved PEBs.

Would you send a patch?

Note, one thing: if I already marked max. possible amount of PEBs as
bad, I just do not reserve any more. But if I have a plenty of available
PEBs anyway (my volumes are smaller than they could be, or I shrink one
of them), and another PEB goes bad, I should just mark it as bad. I may
print a warning, but should not panic.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-06-29 12:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 15:08 [PATCH] UBI: add minimal amount of reserved erase blocks in Kconfig Richard Genoud
2012-06-28 14:39 ` Artem Bityutskiy
2012-06-28 16:07   ` Richard Genoud
2012-06-28 16:22     ` Artem Bityutskiy
2012-06-29  7:17       ` Richard Genoud
2012-06-29 14:10         ` Artem Bityutskiy
2012-06-29 14:57           ` Richard Genoud
2012-06-29 15:07             ` Artem Bityutskiy
2012-06-28 17:53 ` Shmulik Ladkani
2012-06-29 12:47   ` Artem Bityutskiy [this message]
2012-06-30 20:43     ` Shmulik Ladkani
2012-07-02  6:15       ` Richard Genoud
2012-07-03 10:46       ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340974064.3070.177.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard.genoud@gmail.com \
    --cc=shmulik.ladkani@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox