RFC: detect and manage power cut on MLC NAND

Iwo Mergler Iwo.Mergler at netcommwireless.com
Sun Mar 22 19:18:52 PDT 2015


On Fri, 20 Mar 2015 19:26:11 +1100
Boris Brezillon <boris.brezillon at free-electrons.com> wrote:

> You want to do that in order to avoid using 2 Jumbo pages to only
> store a few bytes ?

Yes. I'm already a little unhappy about using two whole pages
for UBI, and don't want to be guilty of doubling that.

> Artem suggested another solution to deal with that: duplicate the EC
> header in the VID header so that EC information can be recovered when
> writing to the page paired with the EC header.

Sounds good to me. It won't avoid the loss of the VID header,
but it will safeguard the EC. It's free, too.

> You'd still have to prevent any write on the page paired with the EC
> header, but you're still saving one page with this approach and avoid
> any corruption of UBI metadata caused by paired pages.

Ah, you probably meant VID header here, right?

> Maybe there are better solution, and I've been thinking about a
> different approach to avoid writing the EC and VID headers in 2
> different pages: store EC header information in a specific UBI volume
> (containing one or two LEBs).
> This volume would store a log of EC information update, so that when
> you erase a page you don't have to write the EC header right away, but
> should just add an entry in the UBI EC log.
> This way you write EC and VID information in one go when someone maps
> a LEB (attach it to a specific volume).

I like that. Maybe UBI could try grouping erases to reduce the
stress on the EC log - write the (future) ECs for a number of
PEBs to the log, then delete the PEBS at leisure, then mark
them as done in the log.

In fact, you could even go and pad the log pages with future
ECs for active PEBs, to be used in case they need erasing later.
Just never erase a PEB that doesn't have an EC log entry.

Would it be possible to push that further, and defer the writing
of the VID header until the first payload write is pending? Up to
that point, it shouldn't matter where the LEB is mapped.

I'm aware that UBIFS would have to cooperate here (first page is
64 bytes smaller), but VID and integrated EC could share the
page 0 with the first payload nodes of the LEB.


Best regards,

Iwo



More information about the linux-mtd mailing list