UBI memory usage on large page nand

Artem Bityutskiy dedekind1 at gmail.com
Fri Apr 15 09:24:12 EDT 2011


On Fri, 2011-04-15 at 16:17 +0300, Artem Bityutskiy wrote:
> On Fri, 2011-04-15 at 16:13 +0300, Artem Bityutskiy wrote:
> > On Fri, 2011-04-15 at 17:23 +0800, Nicholas wrote:
> > > Dear Artem,
> > > 
> > > Thanks for the information. Indeed it has flexibility to be freed or consumed.
> > > Due to my case, i need to use maximum memory space while in the
> > > meantime i also need to write files into nand via ubi.
> > > 8KB page of nand flash will consume 16MB for a single volume on a
> > > single UBI MTD.
> > > 
> > > 1. Is there any idea to reduce the memory consumption ?
> > 
> > Yes. The main idea is as I described: both UBI and UBIFS have several
> > multiple PEB-size buffers at attach/mount time. I did not count them,
> > but I think there may be about 6 of them. All these buffers are
> > allocated using vmalloc(), so you can easily fine all of them, because
> > 'vmalloc()' is used only for those buffers.
> 
> And note, this is all off the top of my head, I might be mistaken
> somewhere. If you need this - you need to spend time with the code and
> try. I'm all yours helping you by looking at your patches and advising.

Hmm, you can also optimize the UBIFS TNC - the cache where we store the
FS indexing information by shrinking the size of 'struct ubifs_znode'.
First of all, use slab cache for znodes, not kmalloc. Second of all,
many fields there do not have to be int.  
    
-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list