All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: Re: Question about mkfs.jffs2 "-s" option
Date: Thu, 3 May 2012 18:21:54 +0000 (UTC)	[thread overview]
Message-ID: <jnuic1$a2n$1@dough.gmane.org> (raw)
In-Reply-To: 20120503211334.17c91b31@halley

On 2012-05-03, Shmulik Ladkani <shmulik.ladkani@gmail.com> wrote:
> Hi Ricard,
> 	
> On Thu, 3 May 2012 09:35:14 +0200 (CEST) Ricard Wanderlof <ricard.wanderlof@axis.com> wrote:
>> 
>> On Wed, 2 May 2012, Grant Edwards wrote:
>> 
>> > The NAND flash I'm using has to be written in 4K blocks -- isn't that
>> > the "page size"?
>> 
>> 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,

It would be cool if that's what the man page actually said. :)

>> 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.

To me, that's the obvious interpretation of the man page, and I swear
I've read "howto" pages at other sites (probably ARM SoC and
eval-board vendors), that explictly told you to set the -s option to
be the flash device's page size.

> Can you tell what's the effect of incorrectly setting it to values
> such as: 512 or 2048 bytes (instead of 4KiB)?
>
> Well, I guess as data is written during runtime by the jffs2 itself,
> and as the GC gets working, new inodes will be correctly created, and
> their sizes will be up to system's page size.
>
> However what happens with these small inodes initially created by
> mkfs.jffs2? "Only" a performance penalty or something worse?

When I created them with 4 byte nodes, the filesystem seemd to work
fine.  It was just shockingly large. :)

-- 
Grant Edwards               grant.b.edwards        Yow! TAILFINS!! ... click
                                  at               ...
                              gmail.com            

  reply	other threads:[~2012-05-03 18:22 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 [this message]
2012-05-04  7:15     ` Artem Bityutskiy
2012-05-04 12:00       ` Shmulik Ladkani

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='jnuic1$a2n$1@dough.gmane.org' \
    --to=grant.b.edwards@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 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.