public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Ferenc Havasi <havasi@inf.u-szeged.hu>
Cc: linux-mtd@lists.infradead.org
Subject: Re: A JFFS2 optimization related to syslog
Date: Tue, 18 Apr 2006 13:32:58 +0200	[thread overview]
Message-ID: <20060418113258.GA4720@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <4444C8FD.1070406@inf.u-szeged.hu>

On Tue, 18 April 2006 13:09:49 +0200, Ferenc Havasi wrote:
> 
> If JFFS2 is used as root filesystem, syslogd/klogd can cause problems,
> because every log line are written out individually, so the log file
> will contain a lot of small nodes. Because a log file can be very large
> (over 30M in our case) it can cause large memory consuption and can make
> the system very slow, especially at opening it after next reboot
> (becauseof the large frag-tree). Unforunatelly garbage collecting also
> does not help, because none of the nodes is obsocalated.

obsoleted

> The small patch below can help a lot. The idea behind it is very simple:
> if there is a write request to write out the end of a page (4K) it will
> write out the full page, not only the last part of it. The result of it
> will be:
> - small nodes will be obscolated
> - garbage collector will be able to delete them
> - after next reboot, when the file is under opening only this "large"
> node will be read, the small node will not be parts of the frag tree
> (thanks to Artem's improvement)
> 
> We think it can be usefull not only for us, and now we don't know about
> any drawback.

Very interesting idea.  I had another one which is more complicated
and it looks like yours is much better.  Just for completeness, here
is mine:
o For every node with less than one page uncompressed size, account it
  some dirty space for it.
o Node header is 68 bytes (on 32bit).  Therefore, a node with 1/2 page
  uncompressed size should cause 34 bytes of "dirty space".
o Complete formula:
  dirty_space = 68 * (PAGE_SIZE - ri->csize) / PAGE_SIZE
o Possibly don't account dirty space if node is last node of a file.

With this little hack, tiny nodes would be garbage collected for being
"dirty space".

Maybe both approaches would make sense, but yours is much simpler and
should be used independently of whether mine makes sense.

> May we commit it into CVS?

Fine with me.  CVS was recently declared dead, so you might want to
commit to git instead.  dwmw2 sent a mail about it to the list.

Jörn

-- 
Data expands to fill the space available for storage.
-- Parkinson's Law

  reply	other threads:[~2006-04-18 11:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-18 11:09 A JFFS2 optimization related to syslog Ferenc Havasi
2006-04-18 11:32 ` Jörn Engel [this message]
2006-04-19 11:00   ` David Woodhouse
2006-04-19 12:45     ` David Woodhouse
2006-04-19 12:55       ` Jörn Engel
2006-05-14  3:22         ` David Woodhouse
2006-04-18 11:46 ` Artem B. Bityutskiy
2006-04-18 11:51   ` Artem B. Bityutskiy
2006-04-18 12:05   ` Jörn Engel

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=20060418113258.GA4720@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=havasi@inf.u-szeged.hu \
    --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