From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ey0-f177.google.com ([209.85.215.177]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QAj3G-00078a-2P for linux-mtd@lists.infradead.org; Fri, 15 Apr 2011 13:27:10 +0000 Received: by eyh6 with SMTP id 6so876413eyh.36 for ; Fri, 15 Apr 2011 06:27:07 -0700 (PDT) Subject: Re: UBI memory usage on large page nand From: Artem Bityutskiy To: Nicholas In-Reply-To: <1302873423.3220.45.camel@localhost> References: <1301671910.2789.98.camel@localhost> <1302873226.3220.43.camel@localhost> <1302873423.3220.45.camel@localhost> Content-Type: text/plain; charset="UTF-8" Date: Fri, 15 Apr 2011 16:24:12 +0300 Message-ID: <1302873852.3220.50.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: linux-mtd@lists.infradead.org Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 (Артём Битюцкий)