A JFFS2 optimization related to syslog

Artem B. Bityutskiy dedekind at yandex.ru
Tue Apr 18 07:46:22 EDT 2006


Hello Ferenc,

Ferenc Havasi wrote:
> Dear All,
> 
> If JFFS2 is used as root filesystem, syslogd/klogd can cause problems,
> because every log line are written out individually, so the log file
> will contain a lot of small nodes. Because a log file can be very large
> (over 30M in our case) it can cause large memory consuption and can make
> the system very slow, especially at opening it after next reboot
> (becauseof the large frag-tree). Unforunatelly garbage collecting also
> does not help, because none of the nodes is obsocalated.
Hmm,

for this testcase you actually want to write entire page if this is the 
last page of this file. But your patch writes entire page if the current 
fragment ends at the end of page, which is different.

I mean, you probably want to do something like this instead:

if ((inode->i_size >> PAGE_CACHE_SHIFT) >= pg->index) {
     /*
      * This is the last page, so unconditionally re-write it fully.
      */
     start = 0;
}

-- 
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.




More information about the linux-mtd mailing list