public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Jamie Lokier <jamie@shareable.org>
Cc: "David Woodhouse" <dwmw2@infradead.org>,
	"Jörn Engel" <joern@logfs.org>,
	linux-mtd@lists.infradead.org, "Josh Boyer" <jwboyer@gmail.com>,
	Duke <ezbonites@gmail.com>
Subject: Re: jffs2: too few erase blocks
Date: Tue, 30 Oct 2007 17:09:49 +0100	[thread overview]
Message-ID: <20071030160948.GD13455@lazybastard.org> (raw)
In-Reply-To: <20071029224638.GA7122@mail.shareable.org>

On Mon, 29 October 2007 22:46:38 +0000, Jamie Lokier wrote:
> 
> Here's an idea for testing:
> 
> [...]

Thank you.  I won't get hacking on this right away, but it is
appreciated.

> > Any filesystem should follow the standards here.  Anything else is a
> > bug.
> 
> True.  But JFFS2 is a bit buggy from an application point of view (*),
> and we care about what an application can actually rely on in
> practice, not what the standard says :-)

Notice the magical word "here". :)

Jffs2 and logfs do diverge from the standards, or at least from other
filesystems.  I am aware of two differences:
- all mounts implicitly set noatime,
- rewriting data in existing non-sparse files can return -ENOSPC.

The first makes at least some sense and the second cannot be avoided for
compressed files.  Logfs allows files to be non-compressing, though.
Any further differences are likely bugs.

> (*) Hence the subject of this thread, and the uncertainty of the
> answer to that question.  Do any of the flash filesystems in
> development guarantee a specific amount of the partition can actually
> be used for data, and return "disk full" deterministically at that
> point, for a given set of file contents?

I'm not sure if I interpret this correctly.  With logfs, compression is
optional.  Disabling compression will remove one uncertainty.  Also both
data and metadata draw from the same pool.  If you create a million
empty files, the space for file content is reduced.  After those two
uncertainties, logfs is deterministic.  Garbage collection will neither
increase nor reduce the amount of available free space.

> Does the answer change if
> compression is disable?  Do any of them not go suspiciously crazy with
> the CPU for a whole minute when it's nearly full, as JFFS2 GC threads
> do occasionally?

Depending on the write pattern, they all will.  When your filesystem is
99% full and your writes are completely random, you end up garbage
collecting 99% old data for every 1% new data.

Well, maybe they won't go crazy for a whole minute.  That can be
avoided.  But they will become slow as molasses.

Two things can be done about this.  First, logfs will let you specify
some amount of space reserved for GC.  With 5% reserved, the
pathological case is much better than with 1% or 0% reserved.

Secondly, the applications should have some amount of structure in their
writes.  If 70% of the filesystem is never moved, the filesystem can
actually get some usage spread.  Having some segments 100% full and some
100% empty translates to good performance.  Having all equally full, as
happens for completely random writes, will give you molasses.

Jörn

-- 
You ain't got no problem, Jules. I'm on the motherfucker. Go back in
there, chill them niggers out and wait for the Wolf, who should be
coming directly.
-- Marsellus Wallace

  reply	other threads:[~2007-10-30 16:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25 14:06 jffs2: too few erase blocks Duke
2007-10-25 14:22 ` Josh Boyer
2007-10-25 22:15   ` Jamie Lokier
2007-10-26 17:00     ` Duke
2007-10-26 21:02       ` Duke
2007-10-28 18:02         ` Jamie Lokier
2007-10-29  2:59           ` David Woodhouse
2007-10-29 14:38             ` Jörn Engel
2007-10-29 20:51               ` Jamie Lokier
2007-10-29 21:40                 ` David Woodhouse
2007-10-29 22:50                   ` Jamie Lokier
2007-10-29 21:54                 ` Jörn Engel
2007-10-29 22:46                   ` Jamie Lokier
2007-10-30 16:09                     ` Jörn Engel [this message]
2007-10-30 20:08                       ` Duke
2007-10-30 20:19                         ` Jörn Engel
2007-10-30 21:42                           ` Duke

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=20071030160948.GD13455@lazybastard.org \
    --to=joern@logfs.org \
    --cc=dwmw2@infradead.org \
    --cc=ezbonites@gmail.com \
    --cc=jamie@shareable.org \
    --cc=jwboyer@gmail.com \
    --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