Reducing of JFFS2 mounting time
sruslan at dev.rtsoft.ru
Wed Dec 17 06:42:15 EST 2003
Some time ago, we faced a problem with a long mounting of high filled JFFS2 filesystem.
On 16Mb FLASH partition, the scanning (and mount, respectively) tooks about 4-5 seconds.
To reduce this time, after looking around of possible ways to improve JFFS2 perfomance in
this area, we decided to move flash scanning process itself into start of garbage collecting
thread. While scanning will not be done, no any access from user-space is allowed, of course,
and we reach it by blocking filesystem with semaphore and counter of already scanned flash blocks.
Since scanning is executing in different kernel thread, user-space 'mount' released relatively fast.
After scan completion, block counter will be equal total number of blocks and completion
semaphore will be released, giving applications right to access filesystem.
In original driver's version, when a filesystem mounted in 'read-only mode', a garbage collection
thread doesn't started; in out modified version, we start this thread anyway, but after scanning
completes, we check with what flags a mounting has been requested. And if we mounts 'read-only',
thread is terminated as usual.
Attached patch have been tested with MontaVista' MVLCEE 2.4.20 Linux kernel. On 16Mb,
100% filled JFFS2 flash partition, a mounting tooks about 800ms.
Guys, if anybody have a time, please take a look at attached work. What do you think about it?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 26093 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20031217/059d7771/attachment.bin
More information about the linux-mtd