From wry+yaffs@ecoscentric.com Wed Jul 01 19:29:33 2009
Received: from hagrid.ecoscentric.com ([212.13.207.197]
	helo=mail.ecoscentric.com) by stoneboat.aleph1.co.uk with esmtps
	(TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69)
	(envelope-from <wry+yaffs@ecoscentric.com>) id 1MM4Yi-0004b0-5V
	for yaffs@lists.aleph1.co.uk; Wed, 01 Jul 2009 19:29:33 +0100
Received: from localhost (hagrid.ecoscentric.com [127.0.0.1])
	by mail.ecoscentric.com (Postfix) with ESMTP id 28D5C151A269
	for <yaffs@lists.aleph1.co.uk>; Wed,  1 Jul 2009 19:29:21 +0100 (BST)
X-Virus-Scanned: amavisd-new at ecoscentric.com
Received: from mail.ecoscentric.com ([127.0.0.1])
	by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new,
	port 10024)
	with ESMTP id KY16MPFn7sAp; Wed,  1 Jul 2009 19:29:19 +0100 (BST)
Received: from [172.20.45.21] (callisto.impropriety.org.uk [90.155.95.198])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	(Authenticated sender: wry@ecoscentric.com)
	by mail.ecoscentric.com (Postfix) with ESMTP id 7D820151A262
	for <yaffs@lists.aleph1.co.uk>; Wed,  1 Jul 2009 19:29:19 +0100 (BST)
Message-ID: <4A4BAAFD.70800@ecoscentric.com>
Date: Wed, 01 Jul 2009 19:29:17 +0100
From: Ross Younger <wry+yaffs@ecoscentric.com>
User-Agent: Thunderbird 2.0.0.22 (X11/20090608)
MIME-Version: 1.0
To: yaffs@lists.aleph1.co.uk
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-SA-Exim-Connect-IP: 212.13.207.197
X-SA-Exim-Mail-From: wry+yaffs@ecoscentric.com
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	stoneboat.aleph1.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=4.5 tests=BAYES_00,SPF_PASS
	autolearn=no version=3.2.5
X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000)
X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk)
Subject: [Yaffs] YAFFS2 memory usage
X-BeenThere: yaffs@lists.aleph1.co.uk
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: Discussion of YAFFS NAND flash filesystem <yaffs.lists.aleph1.co.uk>
List-Unsubscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/options/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=unsubscribe>
List-Archive: <http://lists.aleph1.co.uk/lurker/list/yaffs.html>
List-Post: <mailto:yaffs@lists.aleph1.co.uk>
List-Help: <mailto:yaffs-request@lists.aleph1.co.uk?subject=help>
List-Subscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=subscribe>
X-List-Received-Date: Wed, 01 Jul 2009 18:29:33 -0000

Hi all,

I've ported YAFFS to eCos and am currently confirming the stability of the
port.

I've run into questions surrounding YAFFS's expected memory usage.


The board I am working with at the moment has a Samsung 1Gbit NAND chip (2k
pages x 64 pages per block x 1024 blocks), and I am using the whole NAND as
my filesystem.

I found a hint ("system requirements" in
http://www.yaffs.net/yaffs-direct-user-guide) that one should budget 2 bytes
of RAM per page of NAND. On my chip that comes out to 128kbytes. I then
found http://www.yaffs.net/yaffs-memory-footprint which feels a "better"
estimate given the greater number of inputs.

I have created a test filesystem with 10,000 files of around 10k each. By
the latter estimate above I expect to use around 1.74Mb. On querying my heap
usage, I'm coming in slightly under that at 1.6Mb.

I'm pretty sure this number is accurate as nothing else is calling malloc;
after I unmount the filesystem, heap usage drops to zero.

Admittedly this is a contrived test, but I'm slightly surprised that I came
close to a YAFFS1 estimate despite using the large-page code of YAFFS2;
wasn't there intended to be a saving somewhere? Is this estimate generally
reliable with both small-page and large-page devices? It seems to be more
like an upper bound than an average, which itself would be useful to have
confirmed.

Any insights would be gratefully received...

Thanks in advance,


Ross

-- 
Embedded Software Engineer, eCosCentric Limited.
Barnwell House, Barnwell Drive, Cambridge CB5 8UU, UK.
Registered in England no. 4422071.                 www.ecoscentric.com


