[PATCH 3/4] UBI: Fastmap: Care about the protection queue
Artem Bityutskiy
dedekind1 at gmail.com
Tue Oct 14 03:23:23 PDT 2014
On Mon, 2014-10-13 at 23:04 +0200, Richard Weinberger wrote:
> Am 13.10.2014 um 17:23 schrieb Artem Bityutskiy:
> > Well, used and free are RB-trees, looking them up is slow.
>
> This is true but we'd have to look it up in multiple trees and the protection queue...
Right. 2 RB-trees, and one list. The list is empty most of the time, or
contains one element.
So we'd look-up 2 RB-trees most of the time. Very rarely we'd need to
look at the list containing very few elements.
Not that bad, I think.
> ubi_update_fastmap() takes ubi->wl_lock anyway to block any changes in the free, used, etc. trees
> to make sure that the to be taken state snapshot is consistent.
I think this is fine.
> > But there is a price - memory consumption. We do not want to pay it just
> > for making the inter-subsystems boundaries better, there ought to be a
> > better reason.
> >
> > Say, for an (imaginary) 8GiB NAND chip with 128KiB PEB size this would
> > cost 256KiB of RAM.
>
> Is 128KiB PEB size still realistic on modern NANDs?
> Even if, 256KiB are not much and the kernel consumes this additionally with
> every new release.
Right, but the point is that bigger systems use eMMC and wouldn't bother
with raw flash. Raw flash trending down the smaller systems, where a
hundred of kilobytes matters.
> But I can understand your concerns.
Thanks, yes, my point is to be careful about the RAM we consume, and try
to avoid growing this data structure, an only do it if we have to.
> Okay, I'll try harder to make you happy.
Well, making me happy is not the point of course :-)
Thanks!
--
Artem
More information about the linux-mtd
mailing list