JFFS2 improvement project

University of Szeged

Home - Mount time - Compression - JFFS3

What is the goal of this subproject?

The main goal is to speed up the mount time of JFFS2 - specially when it uses NAND flash.

Our technique is called summary. There are two kinds of summary:

  • Erase Block Summary (EBS)
  • Centralized Summary (CS)

How does Erase Block Summary work?

EBS stores summary information at the end of every (closed) erase block. It is no longer necessary to scan all nodes separetly (and read all pages of them) just read this "small" summary, where every information is stored which is need at mounttime.

This summary information is stored in a JFFS2_FEATURE_RWCOMPAT_DELETE. During the mount process if there is no summary info the orignal scan process will be executed.

There is a user space tool called sumtool to generate this summary information for a JFFS2 image.

EBS works with NAND and NOR flashes, too.

It is now part of the official JFFS2.

How does Centralized Summary work?

CS stores every important memory data structures (relevant parts of inode cache, raw node references, jeb info and lists) onto the flash at umount time. If there was clean umount at the next mount this stored information will be read directly into the memory and additional scanning will not be neccesarry.

There is no user space tool for CS. The first mount will use the original scanning process, and from the second mount will be fast (if there was clean umount before).

CS can store summary information in two ways (can be selected by kconfig):

  • stores reference pointer in the first eraseblock
  • the offset of the summary information should be specified as mount parameter, and can be read using sysfs after clean umount

CS is a very new technique, it should be tested. Now it works only on NAND flashes.


Usage of summary

  • checkout a snapshot from MTD CVS
  • apply the patch above (if you use CS)
  • compile mkfs.jffs2 utility
  • if you would like to use EBS compile sumtool utility
  • generate your image as usual (with mkfs.jffs2). For example: "mkfs.jffs2 -rdir -oout.jffs2 -e128KiB"
  • if you would like to use EBS run sumtool to insert summary information. For example: "sumtool -iout.jffs2 -oout-sum.jffs2 -e128KiB"
  • patch your kernel with the patchkernel.sh. For example: "patchkernel.sh -2 /usr/src/linux"
  • compile your kernel with summary support