public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: j.lambrecht@televic.com
Cc: ecos-discuss@ecos.sourceware.org, linux-mtd@lists.infradead.org
Subject: [ECOS] Re: JFFS2 needs approx 72B of RAM per file
Date: Wed, 23 Apr 2008 12:50:00 -0000	[thread overview]
Message-ID: <1208942722.9212.750.camel@pmac.infradead.org> (raw)
In-Reply-To: <47FAAACB.2060800@telenet.be>

On Tue, 2008-04-08 at 01:14 +0200, Jürgen Lambrecht wrote:
> Hello to ecos-discuss and especially linux-mtd,
> 
> Tests have revealed to me that jffs2 does not only need raw nodes in RAM 
> (I use CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE to have this 
> statically), but also "eats RAM" per file in flash.
> I want to remove this allocation, but I don't know if this is possible, 
> what are the disadvantages....?
> (my basic problem is that I have not enough RAM on my board, but it is 
> too late to change HW for the running projects)
> 
> After reading some jffs2 documentation, I think that my problem is the 
> inode cache?

I don't think so -- I think the raw node references are likely to be the
major contributing factor. It should be easy enough to check though,
surely? 

The problem, fundamentally, is that JFFS2 has no structure on the
medium. We have to _remember_ where every node (log entry) is.

I recently did some work to reduce the amount of memory per node from 16
to 8 bytes -- dropping a ->next pointer by using arrays of the things,
and dropping the 'length' field by observing that it's actually
redundant with 'offset' and '->next->offset' 99% of the time, and
finding tricks to make it redundant _100%_ of the time. If you're not
already using the latest JFFS2 code, it's worth doing that.

I say "recently" -- it's been over the last two years or so, but I don't
think eCos is using the results yet. It'd be good if someone would take
responsibility for merging newer JFFS2 code into eCos (or just tell me
it's not going to happen, and I'll stop trying to keep it feasible).

I extract the JFFS2 core files for use in eCos automatically, into a git
tree at git.infradead.org/users/dwmw2/jffs2-ecos-core.git -- this tracks
Linus' git tree and shuffles the files into the arrangement that they
have in the eCos source tree.

The intention was that someone working on eCos would periodically pull
from that tree into something like the 'jffs2-ecos.git' tree next to it,
which also has the eCos-specific files, and then build and test on eCos.
It doesn't seem to have happened though.

Another way to reduce the amount of memory taken would be to reduce the
number of nodes, which might be achieved by increasing the 'page size'. 
JFFS2 on Linux never writes a data node which crosses from one MMU page
to another, but on eCos you could relax that quite easily and write
larger data nodes -- which depending on the files you store may well
mean you have fewer of them.

-- 
dwmw2


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2008-04-23  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-07 23:20 [ECOS] " Jürgen Lambrecht
2008-04-23 12:50 ` David Woodhouse [this message]
2008-05-30 13:36 [ECOS] " Jürgen Lambrecht

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=1208942722.9212.750.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=j.lambrecht@televic.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).