Understanding page size in jffs2- and kernel-source

Artem Bityutskiy dedekind1 at gmail.com
Wed Oct 19 10:37:44 EDT 2011


On Mon, 2011-10-17 at 10:52 +0200, Freise, Bjoern-Achim wrote:
> Hello,
>  
> we are using Kernel 2.6.28 with mtd-utils 1.0.1 on an ARM at91sam9260
> with a NAND flash with 512 byte pages an 16k erase size. And now I'm
> trying to understand a few things:
>  
> 1) In the kernel source it has PAGE_SIZE and PAGE_CACHE_SIZE with
> 4096. These defines are used in the jffs2 implementation. Is that
> correct when using 512 byte pages in a NAND device?

Kernel macros are about RAM page size, which is 4KiB in most arm
systems. This is not NAND page size.

AFAIR, PAGE_SIZE is the RAM page size, but PAGE_CACHE_SIZE is the page
cache page size, which is in practice is always the same as PAGE_SIZE.
 
> 2) In our build-environment our image is created with "mkfs.jffs2 ....
> --page-size=512.... ". I guess this doesn't match with the above?

This is NAND page size, so looks right.

> 3) What should I use for a good performance (page_size and/or with/out
> compression) when using a large (~ 16MB) sqlite-file?

I do not think you have any choice, unless you are ready to hack
MTD/JFFS2 - use 512.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20111019/59748095/attachment.sig>


More information about the linux-mtd mailing list