From: Thomas Koeller <thomas.koeller@baslerweb.com>
To: ecos-discuss@sources.redhat.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: [ECOS] Stress testing JFFS2
Date: Wed, 15 Oct 2003 10:07:00 -0000 [thread overview]
Message-ID: <200310151211.29172.thomas.koeller@baslerweb.com> (raw)
In-Reply-To: <20031008115231.7d1f012f.jani@iv.ro>
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
next prev parent reply other threads:[~2003-10-15 10:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-08 7:37 Øyvind Harboe
2003-10-08 9:07 ` Jani Monoses
2003-10-15 10:07 ` Thomas Koeller [this message]
2003-10-15 10:52 ` David Woodhouse
2003-10-15 11:26 ` Thomas Koeller
2003-10-16 10:25 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2003-10-16 7:23 Øyvind Harboe
2003-10-16 7:32 ` Andrew Lunn
2003-10-16 7:35 ` Øyvind Harboe
2003-10-15 18:33 Doug Fraser
2003-10-15 11:53 Dinesh Kumar
2003-10-15 12:54 ` Thomas Koeller
2003-10-07 16:43 Øyvind Harboe
2003-10-07 10:57 Øyvind Harboe
2003-10-07 12:31 ` David Vrabel
2003-10-07 13:04 ` Andrew Lunn
2003-10-07 13:16 ` Øyvind Harboe
2003-10-07 13:43 ` Andrew Lunn
2003-10-07 16:42 ` Thomas Koeller
2003-10-07 17:57 ` Andrew Lunn
2003-10-08 8:34 ` Thomas Koeller
2003-10-07 13:36 ` Eric Donnat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200310151211.29172.thomas.koeller@baslerweb.com \
--to=thomas.koeller@baslerweb.com \
--cc=ecos-discuss@sources.redhat.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).