public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Martin Gadbois <martin.gadbois@colubris.com>
To: Simon Munton <Simon.Munton@m4data.co.uk>
Cc: "JFFS (E-mail)" <jffs-dev@axis.com>, "MTD (E-mail)" <mtd@infradead.org>
Subject: Re: Endless garbage collection
Date: Tue, 23 Jan 2001 11:20:20 -0500	[thread overview]
Message-ID: <3A6DAF44.36276D34@colubris.com> (raw)
In-Reply-To: 52AF3CB987C7D41183CD0090271F67C301C7CE@m4eng.m4data.co.uk

Simon Munton wrote:

> It's possible to get the garbage collection going in an endless loop by
> creating lots of small files. eg, if I create 25 files, each 0 bytes long,
> on an empty filesystem, garbage collection starts and goes on and on.
>
> Perhaps the test for too much RAM being used in thread_should_wake() ought
> to take the number of files into account? ie should it be:
>
>         /* If there is too much RAM used by the various structures, GC */
>         if (jffs_get_node_inuse() >
> (c->fmc->used_size/c->fmc->max_chunk_size * 5 + 25 + jffs_get_file_count()))
> {
>
> where  jffs_get_file_count() returns the number of files on the filesystem.

You're absolutly right. The only issues are performance of the
jffs_get_file_count(), because it is executed every times an insert_node() is
called. We should keep a running count of how many files exists in the
partition, but I did not do that yet.
Here's my version:

if (jffs_get_node_inuse() > (c->fmc->used_size/c->fmc->max_chunk_size * 5
                        + jffs_foreach_file(c, jffs_file_count) * 2 + 50))
  return 1;

I suggest to raise 25 to 50, to avoid silly problems like this.



--
Martin Gadbois
S/W designer
Colubris Networks (http://www.colubris.com)





To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

      parent reply	other threads:[~2001-01-23 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-23 15:59 Endless garbage collection Simon Munton
2001-01-23 16:06 ` David Woodhouse
2001-01-23 16:20 ` Martin Gadbois [this message]

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=3A6DAF44.36276D34@colubris.com \
    --to=martin.gadbois@colubris.com \
    --cc=Simon.Munton@m4data.co.uk \
    --cc=jffs-dev@axis.com \
    --cc=mtd@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