Re: [PATCH] ubi: Select fastmap anchor PEBs considering wear level rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Arne,

On Tue, Feb 18, 2020 at 3:00 PM Arne Edholm <arne.edholm@xxxxxxxx> wrote:
>
> Hi Richard,
>
> On 1/13/20 3:56 PM, Arne Edholm wrote:
> > There is a risk that the fastmap anchor PEB is alternating between
> > just two PEBs, the current anchor and the previous anchor that was just
> > deleted. As the fastmap pools gets the first take on free PEBs, the
> > pools may leave no free PEBs to be selected as the new anchor,
> > resulting in the two PEBs alternating behaviour. If the anchor PEBs gets
> > a high erase count the PEBs will not be used by the pools but remain in
> > ubi->free, even more increasing the likelihood they will be used as
> > anchors.
> >
> > Getting stuck using only a couple of PEBs continuously will result in an
> > uneven wear, eventually leading to failure.
> >
> > To fix this:
> >
> > - Choose the fastmap anchor when the most free PEBs are available. This is
> >   during rebuilding of the fastmap pools, after the unused pool PEBs are
> >   added to ubi->free but before the pools are populated again from the
> >   free PEBs. Also reserve an additional second best PEB as a candidate
> >   for the next time the fast map anchor is updated. If a better PEB is
> >   found the next time the fast map anchor is updated, the candidate is
> >   made available for building the pools.
> >
> > - Enable anchor move within the anchor area again as it is useful for
> >   distributing wear.
> >
> > - The anchor candidate for the next fastmap update is the most suited free
> >   PEB. Check this PEB's erase count during wear leveling. If the wear
> >   leveling limit is exceeded, the PEB is considered unsuitable for now. As
> >   all other non used anchor area PEBs should be even worse, free up the
> >   used anchor area PEB with the lowest erase count.
> >
> > Signed-off-by: Arne Edholm <arne.edholm@xxxxxxxx>
> Do you have any comments on this suggestion?

Thank you for working on this. On first sight what you describe makes sense
but I need to verify it first. Fastmap is tricky. ;-\
Maybe we even can have a xfstests test for it.

-- 
Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux