query regarding inode pages

shubham sharma shubham20006 at gmail.com
Wed Jul 13 11:45:47 EDT 2011


I am trying to write a memory based file system. The file system is
intended to create files/directories and write their contents only on
pages. For this I have used the function grab_cache_page() function to
get a new locked page in case the page does not exists in the radix
tree of the inode.

As the filesystem is memory based and all the data exists only on the
memory, so I don't release the lock on the page as I fear that the
pdflush daemon can swap out the pages on which I have written data and
I may never see that data again. I unlock all the pages of all the
inodes of the file system in the kill_sb function once the file system
is being unmounted. But the problem I am facing is that if I open a
file in which I have already written something (and its pages are
locked), the open system call in turn calls the __lock_page() function
which waits for the pages belonging to the inode to get unlocked.
Hence the system call stalls indefinitely. I want to know if there is
a mechanism by which I can prevent the pdflush daemon from swapping
the pages that my filesystem refers to??

What limited knowledge I have on pdflush daemon, I guess that the
daemon searches for the dirty inodes in the list maintained per super
block. So if I remove all the inodes from this list (or not add any of
my inodes I create in the list), will I be able to prevent the daemon
from flushing data from my file system?



More information about the Kernelnewbies mailing list