Re: NAND flash question

Artem B. Bityuckiy
2005-06-29T06:39:41Z

On Tue, 2005-06-28 at 19:20 +0000, Sergei Sharonov wrote:
> Charles,
> > How could one change the flush interval to around 100mS? Or does that sound
> > like a stupid idea?
>
> Just call sync/fsync as needed. Your application should know when to do it.
> Secondly, I believe JFFS2 will flush write buffer no latter then 5 s after
> write (?). Can anybody comment on that?
>
The write buffer flushing mechanism works as follows.

Every time something is written to the WB, the in-RAM superblock
structure object is marked as dirty (sb->s_dirt = 1). pdflush daemon is
the standard daemon which periodically wakes up and flushes dirty pages
and superblocks. So, the jffs2_write_super() will be called by pdflush
when the dirty interval is expired, and the WB will be flushed (and of
course, the s_dirty flag is cleaned). This flushing delay take a chance
that the next writes will be merged with the previous writes before the
WB is flushed.

The dirty expire interval is adjusted by means
of /proc/sys/vm/dirty_expire_centisecs
(seeDocumentation/filesystems/proc.txt) for details.

HTH.

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