public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] JFFS2 needs approx 72B of RAM per file
@ 2008-04-07 23:20 Jürgen Lambrecht
  2008-04-23 12:50 ` [ECOS] " David Woodhouse
  0 siblings, 1 reply; 2+ messages in thread
From: Jürgen Lambrecht @ 2008-04-07 23:20 UTC (permalink / raw)
  To: ecos-discuss, linux-mtd

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?


Kind regards,
Juergen Lambrecht


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS] Re: JFFS2 needs approx 72B of RAM per file
  2008-04-07 23:20 [ECOS] JFFS2 needs approx 72B of RAM per file Jürgen Lambrecht
@ 2008-04-23 12:50 ` David Woodhouse
  0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2008-04-23 12:50 UTC (permalink / raw)
  To: j.lambrecht; +Cc: ecos-discuss, linux-mtd

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-23  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-07 23:20 [ECOS] JFFS2 needs approx 72B of RAM per file Jürgen Lambrecht
2008-04-23 12:50 ` [ECOS] " David Woodhouse

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).