From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27452 invoked by alias); 15 Oct 2003 10:07:54 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 27445 invoked from network); 15 Oct 2003 10:07:53 -0000 Received: from unknown (HELO proxy.baslerweb.com) (145.253.187.130) by sources.redhat.com with SMTP; 15 Oct 2003 10:07:53 -0000 Received: from comm1.baslerweb.com ([172.16.13.2]) by proxy.baslerweb.com (Post.Office MTA v3.5.3 release 223 ID# 0-0U10L2S100V35) with ESMTP id com; Wed, 15 Oct 2003 12:06:05 +0200 Received: from 172.16.13.253 (VCLINUX-1 [172.16.13.253]) by comm1.baslerweb.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id 32J5G9WK; Wed, 15 Oct 2003 12:08:19 +0200 From: Thomas Koeller Organization: Basler AG To: ecos-discuss@sources.redhat.com Date: Wed, 15 Oct 2003 10:07:00 -0000 User-Agent: KMail/1.5.2 References: <1065598642.12197.6.camel@famine> <20031008115231.7d1f012f.jani@iv.ro> In-Reply-To: <20031008115231.7d1f012f.jani@iv.ro> Cc: linux-mtd@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310151211.29172.thomas.koeller@baslerweb.com> Subject: Re: [ECOS] Stress testing JFFS2 X-SW-Source: 2003-10/txt/msg00247.txt.bz2 In an attempt to understand what's really going on inside JFFS2, I spent a day analyzing the code. Here's what I found. Please everybody comment on this and correct any errors on my side. - Every operation that changes the contents of the FLASH (even deleting files!) is performed by writing new nodes to the FLASH. Every such node is represented in RAM by a struct jffs2_raw_node_ref. The memory occupied by these structs is never freed unless the file system is unmounted or garbage collection takes place. Garbage collection starts when there are only five empty erase blocks left. Since every data node on the flash can hold at most one page (4KB) worth of data (uncompressed), the number of in-core instances of struct jffs2_raw_node_ref can grow very large. So in order to support a larger JFFS2 file system, an appropriate amount of RAM is absolutely required. - The size of a single struct jffs2_raw_node_ref is 16 bytes. In ecos, these structs are allocated through calls to malloc(). If the underlying implementation is dlmalloc, as is probably the case most often, the minimum allocation size is 24 bytes, so some memory is wasted here. A fixed-size block allocator would be more appropriate. - In http://lists.infradead.org/pipermail/linux-mtd/2003-August/008372.html, David Woodhouse comments on this, suggesting possible improvements. I do not know if any work is going on to implement one of these (probably not). When I originally decided to design my system around JFFS2 I was totally unaware of these topics. Although everything I found is implicit in David Woodhouse's paper 'JFFS : The Journalling Flash File System', it is not stated explicitly anywhere, so I'm doing it here and now: Do not use large JFFS2 file systems if RAM is a scarce resource! tk -------------------------------------------------- Thomas Koeller, Software Development Basler Vision Technologies An der Strusbek 60-62 22926 Ahrensburg Germany Tel +49 (4102) 463-162 Fax +49 (4102) 463-239 mailto:thomas.koeller@baslerweb.com http://www.baslerweb.com ============================== -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss