summaryrefslogtreecommitdiff
path: root/include/linux/dcache.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-06-23 18:54:04 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-23 18:54:04 -0700
commita44115192f55f8b7a22d511cc194d7880a2ba553 (patch)
tree89308d34bf2626b2a4d707f7dab8dcb9383870f5 /include/linux/dcache.h
parent42b8d9947462d751f1a4cd6c7e842d95c3249f35 (diff)
[PATCH] vm: vfs shrinkage tuning
Some people want the dentry and inode caches shrink harder, others want them shrunk more reluctantly. The patch adds /proc/sys/vm/vfs_cache_pressure, which tunes the vfs cache versus pagecache scanning pressure. - at vfs_cache_pressure=0 we don't shrink dcache and icache at all. - at vfs_cache_pressure=100 there is no change in behaviour. - at vfs_cache_pressure > 100 we reclaim dentries and inodes harder. The number of megabytes of slab left after a slocate.cron on my 256MB test box: vfs_cache_pressure=100000 33480 vfs_cache_pressure=10000 61996 vfs_cache_pressure=1000 104056 vfs_cache_pressure=200 166340 vfs_cache_pressure=100 190200 vfs_cache_pressure=50 206168 Of course, this just left more directory and inode pagecache behind instead of vfs cache. Interestingly, on this machine the entire slocate run fits into pagecache, but not into VFS caches. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r--include/linux/dcache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 72f48658a7d7..66e27328434b 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -313,6 +313,8 @@ static inline int d_mountpoint(struct dentry *dentry)
extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
+extern int sysctl_vfs_cache_pressure;
+
#endif /* __KERNEL__ */
#endif /* __LINUX_DCACHE_H */