All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Artem Bityutskiy <dedekind1@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Brian Norris" <computersforpeace@gmail.com>,
	"Andrea Scian" <rnd4@dave-tech.it>,
	"Qi Wang 王起 (qiwang)" <qiwang@micron.com>,
	"Iwo Mergler" <Iwo.Mergler@netcommwireless.com>,
	"Jeff Lauruhn (jlauruhn)" <jlauruhn@micron.com>
Subject: Re: UBI/UBIFS: dealing with MLC's paired pages
Date: Tue, 29 Sep 2015 13:19:01 +0200	[thread overview]
Message-ID: <560A73A5.2070406@nod.at> (raw)
In-Reply-To: <20150917152240.757c9e90@bbrezillon>

Hi!

Am 17.09.2015 um 15:22 schrieb Boris Brezillon:
> Hello,
> 
> I'm currently working on the paired pages problem we have on MLC chips.
> I remember discussing it with Artem earlier this year when I was
> preparing my talk for ELC.
> 
> I now have some time I can spend working on this problem and I started
> looking at how this can be solved.
> 
> First let's take a look at the UBI layer.
> There's one basic thing we have to care about: protecting UBI metadata.
> There are two kind of metadata:
> 1/ those stored at the beginning of each erase block (EC and VID
>    headers)
> 2/ those stored in specific volumes (layout and fastmap volumes)
> 
> We don't have to worry about #2 since those are written using atomic
> update, and atomic updates are immune to this paired page corruption
> problem (either the whole write is valid, or none of it is valid).
> 
> This leaves problem #1.
> For this case, Artem suggested to duplicate the EC header in the VID
> header so that if page 0 is corrupted we can recover the EC info from
> page 1 (which will contain both VID and EC info).
> Doing that is fine for dealing with EC header corruption, since, AFAIK,
> none of the NAND vendors are pairing page 0 with page 1.
> Still remains the VID header corruption problem. Do prevent that we
> still have several solutions:
> a/ skip the page paired with the VID header. This is doable and can be
>    hidden from UBI users, but it also means that we're loosing another
>    page for metadata (not a negligible overhead)
> b/ storing VID info (PEB <-> LEB association) somewhere else. Fastmap
>    seems the right place to put that in, since fastmap is already
>    storing those information for almost all blocks. Still we would have
>    to modify fastmap a bit to store information about all erase blocks
>    and not only those that are not part of the fastmap pool.
>    Also, updating that in real-time would require using a log approach,
>    instead of the atomic update currently used by fastmap when it runs
>    out of PEBs in it's free PEB pool. Note that the log approach does
>    not have to be applied to all fastmap data (we just need it for the
>    PEB <-> LEB info).
>    Another off-topic note regarding the suggested log approach: we
>    could also use it to log which PEB was last written/erased, and use
>    that to handle the unstable bits issue.
> c/ (also suggested by Artem) delay VID write until we have enough data
>    to write on the LEB, and thus guarantee that it cannot be corrupted
>    (at least by programming on the paired page ;-)) anymore.
>    Doing that would also require logging data to be written on those
>    LEBs somewhere, not to mention the impact of copying the data twice
>    (once in the log, and then when we have enough data, in the real
>    block).

Let's start with UBI, as soon it is stable on MLC NAND we can focus on
UBIFS.

Solution a) sounds very promising to me as the can be implemented easily
and loosing another page for meta data is IMHO acceptable on MLC.
Especially as MLC NANDs are anyways bigger and cheaper than SLC.

b) is tricky as fastmap follows the design principle that UBI can fall
back to a full scan if the fastmap is corrupted or a self check fails.
If the ability to full scan suddenly depends on fastmap it can become
messy.

In terms of computer science c) is the most elegant solution but converting
UBI to a log based "block layer" is not trivial and as you wrote the write
overhead is not negligible.

So, I'd vote for a) and see how well it does in our powercut tests. :-)

Thanks,
//richard

  parent reply	other threads:[~2015-09-29 11:19 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17 13:22 UBI/UBIFS: dealing with MLC's paired pages Boris Brezillon
2015-09-17 15:20 ` Artem Bityutskiy
2015-09-17 15:46   ` Boris Brezillon
2015-09-17 16:47     ` Richard Weinberger
2015-09-18  7:17       ` Andrea Scian
2015-09-18  7:41         ` Boris Brezillon
2015-09-18  7:54         ` Artem Bityutskiy
2015-09-18  7:57           ` Bityutskiy, Artem
2015-09-18  9:38           ` Andrea Scian
2015-09-24  1:57             ` Karl Zhang 张双锣 (karlzhang)
2015-09-24  6:31               ` Richard Weinberger
2015-09-24  7:43               ` Boris Brezillon
2015-09-24  9:44                 ` Stefan Roese
2015-09-29 11:19 ` Richard Weinberger [this message]
2015-09-29 12:51   ` Boris Brezillon
2015-10-23  8:14 ` Boris Brezillon
2015-10-27 20:16   ` Richard Weinberger
2015-10-28  9:24     ` Boris Brezillon
2015-10-28 10:44       ` Michal Suchanek
2015-10-28 11:14         ` Boris Brezillon
2015-10-28 15:50           ` Michal Suchanek
2015-10-28 12:24   ` Artem Bityutskiy
2015-10-30  8:15     ` Boris Brezillon
2015-10-30  8:21       ` Boris Brezillon
2015-10-30  8:50       ` Bean Huo 霍斌斌 (beanhuo)
2015-10-30  9:08       ` Artem Bityutskiy
2015-10-30  9:45         ` Boris Brezillon
2015-10-30 10:09           ` Artem Bityutskiy
2015-10-30 11:49             ` Michal Suchanek
2015-10-30 12:47               ` Artem Bityutskiy
2015-10-30 11:43           ` Artem Bityutskiy
2015-10-30 11:59             ` Richard Weinberger
2015-10-30 12:29               ` Artem Bityutskiy
2015-10-30 12:31                 ` Bityutskiy, Artem
2015-10-30 12:30             ` Boris Brezillon
2015-10-30 12:41               ` Artem Bityutskiy
2015-10-28 12:06 ` Artem Bityutskiy
     [not found] <A765B125120D1346A63912DDE6D8B6310BF4CAA8@NTXXIAMBX02.xacn.micron.com>
2015-09-25  7:30 ` Boris Brezillon
2015-09-25  8:25   ` Bean Huo 霍斌斌 (beanhuo)
2015-09-25  8:35     ` Richard Weinberger
2015-09-25  8:48     ` Boris Brezillon
2015-09-25  8:30   ` Karl Zhang 张双锣 (karlzhang)
2015-09-25  8:56     ` Boris Brezillon

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=560A73A5.2070406@nod.at \
    --to=richard@nod.at \
    --cc=Iwo.Mergler@netcommwireless.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=jlauruhn@micron.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=qiwang@micron.com \
    --cc=rnd4@dave-tech.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.