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 12:11:29 +0200 [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
==============================
next parent reply other threads:[~2003-10-15 10:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1065598642.12197.6.camel@famine>
[not found] ` <20031008115231.7d1f012f.jani@iv.ro>
2003-10-15 10:11 ` Thomas Koeller [this message]
2003-10-15 10:52 ` [ECOS] Stress testing JFFS2 David Woodhouse
2003-10-15 11:30 ` Thomas Koeller
2003-10-16 10:25 ` David Woodhouse
[not found] <20031015115257.16327.qmail@web8006.mail.in.yahoo.com>
2003-10-15 12:58 ` Thomas Koeller
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