public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: mkfs.jffs2 min erase block size: 4 vs 8 KiB
Date: Fri, 24 Jun 2011 15:07:02 +0300	[thread overview]
Message-ID: <1308917226.7715.6.camel@koala> (raw)
In-Reply-To: <BANLkTi=G+HxWtLgj6wUSQAY1FfjTFC8JjQ@mail.gmail.com>

On Wed, 2011-06-22 at 01:02 -0400, Mike Frysinger wrote:
> the current mkfs.jffs2 util has in its --eraseblock handling:
> /* If it's less than 8KiB, they're not allowed */
> if (erase_block_size < 0x2000) {
>     fprintf(stderr, "Erase size 0x%x too small. Increasing to 8KiB minimum\n",
>         erase_block_size);
>     erase_block_size = 0x2000;
> }
> 
> but i cant seem to find documentation on where this comes from.  it's
> not uncommon to have SPI flashes with 4KiB erase sectors, and removing
> this sanity check and allowing 4 KiB seems to produce an image that
> works OK.
> 
> am i missing something ?  or should i send a patch to drop this check ?

I do not believe JFFS2 is able to work with such small erase blocks. In
JFFS2 (and in UBIFS as well) an eraseblock is the basic garbage
collection unit, and nodes cannot cross eraseblock boundaries. And the
maximum node size is 4KiB of data plus few bytes of node header. So 4KiB
won't even fit the largest data node, e.g., containing uncompressible
data.

Even 8KiB is bad, because the amount of wasted space will be large -
JFFS2 will waste the rest of the eraseblock if it does not fit the node.
So the smaller EB is, the more wasted space you have.

For SPI flashes the way out is to emulate larger eraseblock sizes on MTD
level. I'd recommend at least 32 KiB.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)

  parent reply	other threads:[~2011-06-24 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  5:02 mkfs.jffs2 min erase block size: 4 vs 8 KiB Mike Frysinger
2011-06-22  8:30 ` Guillaume LECERF
2011-06-24 12:07 ` Artem Bityutskiy [this message]
2011-06-24 17:10   ` Mike Frysinger
2011-06-24 19:20     ` Artem Bityutskiy
2011-06-24 19:23       ` Mike Frysinger
2011-06-24 19:29         ` Artem Bityutskiy

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=1308917226.7715.6.camel@koala \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vapier.adi@gmail.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