caching questions with jffs2

David Woodhouse dwmw2 at
Sat Dec 8 04:51:48 EST 2001

kristen.carlson at said:
> Can someone describe to me the algorithm used for freeing memory that
> has been cached due to file activity in jffs2?  Is this done as part
> of the garbage collector?  How long does the cached memory stay
> around?  Is this tunable?

At all times while mounted, JFFS2 keeps a list of the offsets of each 
physical node belonging to each inode.

On read_inode(), it reads each physical node and builds up a full map of 
where data are found for each range of bytes in the file. 

On read(), it just reads data into the page cache. Normal Linux cache 
eviction rules apply to data pages.

On clear_inode(), the extra stuff allocated in read_inode() is freed.

The paper linked from may help to shed 
light on this.


More information about the linux-mtd mailing list