public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: "Artem B. Bityuckiy" <dedekind@infradead.org>
Cc: MTD List <linux-mtd@lists.infradead.org>
Subject: Re: JFFS3 memory consumption
Date: Wed, 26 Jan 2005 09:10:47 +0000	[thread overview]
Message-ID: <1106730647.6480.190.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.58.0501260841380.3222@phoenix.infradead.org>

On Wed, 2005-01-26 at 08:44 +0000, Artem B. Bityuckiy wrote:
> K1 is decreased by the Ferenc Havasi's "summary" patch well. Would be
> nice to decrease K2 either. Any Ideas how to do so?

For a start, we can increase the maximum node size. Limiting it to
PAGE_SIZE means we have a larger number of nodes than we'd otherwise
have. If we quadruple that, we'll probably end up with about a third as
many nodes. 

We can also look at true write-behind caching, if we're a _lot_ more
careful about free space than we are now. To have data outstanding in
the page cache, we need to be able to guarantee that we have enough free
space to write it out, and we need to be able to write it out _without_
allocating memory. That includes any memory which might be required for
GC. Doing that would allow us to coalesce writes so we fill a page (or a
full node size) more often.

Removing the __totlen field from the node ref is also a 25% improvement
in its ram usage.

Also, perhaps we could use _arrays_ of nodes instead of lists? That
would allow us to drop one of the list pointers. Probably it's easiest
to do this for the next_phys list -- make it an array in physical order.
I'm not sure how workable that would be. You'd need to deal with
reallocation, and it'd be hard to remove obsolete elements from the
middle; you'd probably just have to leave them there.

Perhaps we can use values other than pointers in our next_phys and
next_in_ino lists. These objects are in slab caches, and are quite
neatly laid out. We could find a way of referencing them which doesn't
require a whole 32 bits (or 64 on some machines).

Another idea which I don't think is workable but which someone may be
able to get something from... can we reduce the 'offset' to something
smaller than 32 bits? Make it an offset within the block instead of from
the start of the medium? Probably hard because it's not that quick to
_find_ the block given just a raw_node_ref*. But if we've already put
all the nodes for a given block into an _array_ rather than a linked
list then maybe...

There are some implementable ideas in there, and some more random ones. 
It's all still linear though.

-- 
dwmw2

  reply	other threads:[~2005-01-26  9:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-26  8:44 JFFS3 memory consumption Artem B. Bityuckiy
2005-01-26  9:10 ` David Woodhouse [this message]
2005-01-26 15:57   ` Artem B. Bityuckiy
2005-01-26 17:06     ` Josh Boyer
2005-01-26 17:11       ` Artem B. Bityuckiy
2005-01-26 18:15         ` David Woodhouse
2005-01-26 18:33           ` Artem B. Bityuckiy
2005-01-26 18:55             ` David Woodhouse
2005-01-27 17:35   ` Artem B. Bityuckiy
2005-01-27 20:23     ` Thomas Gleixner
2005-01-27 22:35       ` David Woodhouse
2005-01-28  0:19         ` Thomas Gleixner
2005-01-28  0:33           ` David Woodhouse
2005-01-28  0:44             ` Thomas Gleixner
2005-01-28  8:45               ` Artem B. Bityuckiy
2005-01-28  9:03                 ` Thomas Gleixner
2005-01-28  9:23                   ` Artem B. Bityuckiy
2005-01-28 18:57                     ` Artem B. Bityuckiy
2005-01-30 18:23                       ` Artem B. Bityuckiy
2005-01-30 18:58                       ` Artem B. Bityuckiy
2005-01-31 16:46                         ` Jared Hulbert
2005-01-31 18:05                           ` Artem B. Bityuckiy
2005-02-01 16:49                             ` Thomas Gleixner
2005-02-02 15:44                               ` Artem B. Bityuckiy
2005-02-02 18:34                                 ` Jared Hulbert
2005-02-02 19:02                                   ` Thomas Gleixner
2005-02-03 10:54                                   ` Artem B. Bityuckiy
2005-01-28  1:53             ` Josh Boyer
2005-01-28  8:50       ` Artem B. Bityuckiy

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=1106730647.6480.190.camel@localhost.localdomain \
    --to=dwmw2@infradead.org \
    --cc=dedekind@infradead.org \
    --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