Re: How can TUX user module get notified when a page is removed from cache?
Ingo Molnar <[email protected]>
| Newsgroups | gmane.network.tux |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 28 Mar 2002, Liang Yang wrote: > We can use path_walk() to query Linux kernel file system whether a > specific file is in the memory cache or not, but now we want our TUX > user space module to get notified regularly from Linux kernel when a > page is removed from memory cache or a page is added to the memory > cache? The purpose of this is we try to maintain a table in user module > to record the status of files which are once accessed. It seems we need > to install a callback function in TUX user module for this event. How > can we do that? could you tell us a bit more about why such a callback is needed? > BTW, which function can we use to get the information of all cached > files in Linux kernel so that we can know which files are cached > currently? it might be possible to just look at whether the dentry is cached or not. Ie. call path_walk with the atomic-lookup bit set, and if it returns a dentry then the file is 'cached'. but as long as contents go, a file might be not cached or partially cached or fully cached. There is no easily accessible information about this - the pagecache is transparent to TUX. Ingo