All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
To: dedekind1@gmail.com, Ricard Wanderlof <ricard.wanderlof@axis.com>
Cc: Grant Edwards <grant.b.edwards@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: Question about mkfs.jffs2 "-s" option
Date: Fri, 4 May 2012 15:00:01 +0300	[thread overview]
Message-ID: <20120504150001.4268beea@halley> (raw)
In-Reply-To: <1336115737.30168.20.camel@sauron.fi.intel.com>

Hi Artem, Ricard,

On Fri, 04 May 2012 10:15:37 +0300 Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Thu, 2012-05-03 at 21:13 +0300, Shmulik Ladkani wrote:
> > On Thu, 3 May 2012 09:35:14 +0200 (CEST) Ricard Wanderlof <ricard.wanderlof@axis.com> wrote:
> > > 
> > > The smallest writable unit in a NAND flash is called a 'page', but AFAIK 
> > > this is not what the -s option in mkfs.jffs2 is for. Instead, it is 
> > > related for the kernel memory managament page size, which is 4k for most 
> > > architectures.
> > 
> > According to MKFS.JFFS2(1),
> > 
> > 	-s, --pagesize=SIZE
> > 		Use page size SIZE.  The default is 4 KiB.  This size is
> > 		the maximum size of a data node.
> > 
> > And according to http://linux-mtd.infradead.org/~dwmw2/jffs2.pdf
> > 
> > 	In order to facilitate rapid decompression of
> > 	data upon readpage() requests, nodes contain
> > 	no more than a single page of data, according to
> > 	the hardware page size on the target platform.
> > 
> > Wow.
> > I always assumed I had to set it according to NAND's page size, not
> > according to target system's mm page size.
> 
> Shmulik, I can give some info about this. First of all because of
> compression and very different node sizes (UBIFS and JFFS2) and because
> JFFS2 was designed for NOR flash originally - NAND page size is not
> something which affects the design of file-systems, or their on-flash
> layout. We use write-buffers on I/O level to make it appear like the
> eraseblock is byte-writable.
> 
> The RAM page size comes from the general linux design - the VFS writes
> in RAM page size units, and it is much simpler to make max node size =
> PAGE_CACHE_SIZE rather than trying to split it when the PAGE_CACHE_SIZE
> is something like 16KiB. This is where this -s stuff comes from. I think
> it was a mistake to introduce this parameter because it is very unlikely
> JFFS2 is/was used on systems with a different PAGE_CACHE_SIZE.

Thanks for the explanations.
I pretty much realized this after reading [1]...

BTW, googling [mkfs.jffs2 and "-s 0x200"] or [mkfs.jffs2 and "-s 0x800"]
yielded few howtos, faqs, and alike....
Guess I wasn't the only one fooled by the argument's name :-))

[1] http://linux-mtd.infradead.org/~dwmw2/jffs2.pdf

Regards
Shmulik

      reply	other threads:[~2012-05-04 12:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 16:08 Question about mkfs.jffs2 "-s" option Grant Edwards
2012-05-03  6:51 ` Shmulik Ladkani
2012-05-03 14:11   ` Grant Edwards
2012-05-03  7:35 ` Ricard Wanderlof
2012-05-03 14:12   ` Grant Edwards
2012-05-03 18:13   ` Shmulik Ladkani
2012-05-03 18:21     ` Grant Edwards
2012-05-04  7:15     ` Artem Bityutskiy
2012-05-04 12:00       ` Shmulik Ladkani [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=20120504150001.4268beea@halley \
    --to=shmulik.ladkani@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=grant.b.edwards@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=ricard.wanderlof@axis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.