2010-01-25 04:07:40 JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85081
Hi,
I use jffs2 filesystem on flash :
root:/proc> cat mounts
rootfs / rootfs rw 0 0
/dev/root / ext2 rw 0 0
none /proc proc rw 0 0
/dev/ram0 /var ramfs rw 0 0
none /sys sysfs rw 0 0
/dev/mtdblock4 /flash jffs2 rw 0 0
After booting the Kernel, when I first do a "ls /flash", it takes almost 2 minutes for the command to complete. The next "ls /flash" commands behave normal and return immediately with the result. The flash directory contains 3 files :
root:/flash> ls -al
drwxr-xr-x 4 root root 0 Jan 1 1970 .
drwxr-xr-x 15 root root 1024 Jan 21 2010 ..
drwxr-xr-x 2 root root 0 Jan 1 2005 rfu
-rw-r--r-- 1 root root 3190783 Jan 1 2007 xt100param
-rw-r--r-- 1 root root 1256 Jan 1 2007 xt100status
Why that long delay the first time I do an ls ? Is the large file in the directory causing the delay ?
TranslateQuoteReplyEditDelete
2010-01-25 10:39:03 Re: JFFS2 on flash
Mike Frysinger (UNITED STATES)
Message: 85092
try this:
https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:jffs#jffs2_mount_process_speedup
QuoteReplyEditDelete
2010-01-26 02:47:03 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85118
I enabled the "JFFS2 summary support" option and rebuild the Kernel, but it makes almost no difference. It speeds up a little bit, but it still takes almost 2 minutes for the (first) ls command to finish.
TranslateQuoteReplyEditDelete
2010-01-26 03:04:14 Re: JFFS2 on flash
Mike Frysinger (UNITED STATES)
Message: 85120
enabling the kernel option isnt the only thing you need to do. you need to specifically format the jffs2 image to match your actual flash.
does the delay happen every time you reboot, or only once per image flash ?
QuoteReplyEditDelete
2010-01-26 03:41:33 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85161
The delay indeed happens every time I boot. After boot, the first ls has the delay. The following ls's don't have a delay.
TranslateQuoteReplyEditDelete
2010-01-26 09:15:05 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85165
Is this something that has changed compared to 2006R2 ? I don't remember having done something special in my old 2006R2 version, to speed up JFFS2. I never had that delay behaviour either in that version.
TranslateQuoteReplyEditDelete
2010-01-26 09:29:27 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85166
Maybe related to this problem : when I reboot my board I get the following output on the console :
root:/> reboot
jffs2: No clean, dirty _or_ erasable blocks to GC from! Where are they all?
jffs2: Couldn't find erase block to garbage collect!
Restarting system.
TranslateQuoteReplyEditDelete
2010-01-26 10:20:13 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85167
Apparently, not the total size of all the files in the filesystem causes the problem, but the size of the individual files. If I put a file of 1Mb in the filesystem, I have an important delay. When I put 10 files of 100K in the filesystem, I only notice a very small delay, almost not noticeable.
TranslateQuoteReplyEditDelete
2010-01-27 07:10:00 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85204
Can the delay-problem be related to the garbage collector ?
TranslateQuoteReplyEditDelete
2010-01-27 07:54:14 Re: JFFS2 on flash
Mike Frysinger (UNITED STATES)
Message: 85205
the GC does run at mount time from what i understand, so if the GC cant find blocks it needs to maintain state, it'll scan the entire fs when you mount it.
but this is one of the things that summary support is supposed to address.
QuoteReplyEditDelete
2010-01-27 08:19:47 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85206
Mike,
As far as I understand, the summary report is speeding up the mounting process. But I'm not sure the problem I see is something related to the mounting process. When I do the ls command from the prompt, the system is up and running, so I suppose the mounting process has already finished at that point. Or is it still running in background ? Or is part of the mounting process performed the first time the filesystem is accessed ?
TranslateQuoteReplyEditDelete
2010-01-28 04:26:45 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85255
Hi Mike,
I build the kernel with 'make MTD_SUMTOOLS_FLAGS='-l -p -e 0x20000' MKFS_JFFS2_FLAGS='-l -p -e 0x20000', as described in the JFFS2 document you mentioned. However, it makes no difference. The first ls is still very slow.
Other suggestions ?
TranslateQuoteReplyEditDelete
2010-01-28 04:35:57 Re: JFFS2 on flash
Mike Frysinger (UNITED STATES)
Message: 85256
i'm by no means a jffs2 expert ... just picked up pieces in passing
what release are you using atm ? might have to review the changesets to fs/jffs2/ to see if there's anything addressing this sort of bug.
QuoteReplyEditDelete
2010-01-28 07:22:07 Re: JFFS2 on flash
Filip Vanalme (BELGIUM)
Message: 85262
Finally found what the problem was : the value of the 'JFFS2 debugging verbosity" configuration parapeter was still on 2. After changing this to 0, the delay dissappeared. Obviously, the verbosity has an important effect on the first access to the JFFS2 fs.