public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Øyvind Harboe" <oyvind.harboe@zylin.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] JFFS2 eats memory
Date: Tue, 13 Jul 2004 07:58:00 -0000	[thread overview]
Message-ID: <1089705498.5995.7.camel@famine> (raw)
In-Reply-To: <20040713074052.GO18802@lunn.ch>

On Tue, 2004-07-13 at 09:40, Andrew Lunn wrote:
> On Mon, Jul 12, 2004 at 04:42:11PM +0200, ?yvind Harboe wrote:
> > This issue has been discussed before, and although I have a workaround,
> > I'd dearly like to have it put to bed since it is starting to cause
> > problems elsewhere in my application:
> > 
> > - My code opens a file for writing with O_TRUNC set, performs
> > a single write call, closes the file.
> > - After closing the file, JFFS2 has eaten memory.
> > - With the attached modifcations to JFFS2, it "only" eats 24 bytes.
> > - If I unmount and remount JFFS2, no memory is "lost" and JFFS2 works
> > fine.
> > 
> > Presumably when the raw nodes in the file fragement list are marked as
> > obsolete, they are no longer required, but are not freed.
> > 
> > Q: Is this fundamentally impossible or a "bad idea" to fix?
> 
> How much memory are we talking about here in this example?

24 bytes* number of write() operations for each time a file is
truncated.

Additionally, memory is lost for other operations(e.g. deleting files),
but I don't have any numbers(24 bytes for every time a file is
deleted?).

I'd really like to see that JFFS2 memory usage was constant if the
number of files(and sections within those files) is constant. That way I
could just run my system and measure the maximum usage.

> The cache is there for a reason, so i would not want to
> unconditionally disable it. At least you need some CDL to control
> between fat & fast and slow & slim.

Is JFFS2 faster because it caches raw_node_ref's to deleted nodes?

Sounds strange.

The mount code simply ignores these nodes, which insinuates that caching
these nodes does not help performance.

> I would also suggest you consider extending the
> CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE concept to the inode
> cache.  You can then control the size of the cache. 

AFAICT, this setting is no help in this case, because all it would do is
to cause JFFS2 operations to fail when running out of pool space instead
of when running out of overall system memory.

Further it would lock a piece of the overall system memory to JFFS2,
making the global memory situation worse.

> 
>         Andrew
-- 
Øyvind Harboe
http://www.zylin.com



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

  parent reply	other threads:[~2004-07-13  7:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-12 14:42 Øyvind Harboe
2004-07-13  7:40 ` Andrew Lunn
2004-07-13  7:53   ` Andrew Lunn
2004-07-13  8:09     ` Øyvind Harboe
2004-07-13  8:31     ` Øyvind Harboe
2004-07-13  7:58   ` Øyvind Harboe [this message]
2004-07-13  9:30 ` David Woodhouse
2004-07-13  9:49   ` Øyvind Harboe
2004-07-13 10:05     ` David Woodhouse
2004-07-13 10:39       ` Øyvind Harboe
2004-07-13 13:41       ` Øyvind Harboe
2004-07-13 23:01         ` [ECOS] " David Woodhouse
2004-07-14  8:15           ` Øyvind Harboe
2004-07-19 14:25             ` Øyvind Harboe
2004-07-19 15:15               ` David Woodhouse
2004-07-19 16:32                 ` Øyvind Harboe
2004-07-20  6:42                   ` David Woodhouse
2004-07-20  7:51                     ` Øyvind Harboe
2004-07-20 14:25                       ` David Woodhouse
2004-07-20 15:51                         ` Øyvind Harboe
2004-07-20 16:08                           ` David Woodhouse
2004-07-20 20:29                             ` Øyvind Harboe
2004-07-21  2:28                               ` David Woodhouse
2004-07-21  7:54                                 ` Øyvind Harboe
     [not found]                                   ` <1090410703.4280.10.camel@localhost.localdomain>
2004-07-21 12:50                                     ` Øyvind Harboe
2004-07-21 16:33                                       ` David Woodhouse
2004-07-20 13:46                     ` Øyvind Harboe
2004-07-13 10:08     ` [ECOS] " Thomas Koeller
2008-04-08 15:28 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=1089705498.5995.7.camel@famine \
    --to=oyvind.harboe@zylin.com \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@sources.redhat.com \
    /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).