summaryrefslogtreecommitdiff
path: root/kernel
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 /kernel
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 'kernel')
-rw-r--r--kernel/sysctl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 7dca63a88ea2..641727bab22f 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -39,6 +39,8 @@
#include <linux/initrd.h>
#include <linux/times.h>
#include <linux/limits.h>
+#include <linux/dcache.h>
+
#include <asm/uaccess.h>
#ifdef CONFIG_ROOT_NFS
@@ -777,6 +779,16 @@ static ctl_table vm_table[] = {
.strategy = &sysctl_intvec,
.extra1 = &zero,
},
+ {
+ .ctl_name = VM_VFS_CACHE_PRESSURE,
+ .procname = "vfs_cache_pressure",
+ .data = &sysctl_vfs_cache_pressure,
+ .maxlen = sizeof(sysctl_vfs_cache_pressure),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ .strategy = &sysctl_intvec,
+ .extra1 = &zero,
+ },
{ .ctl_name = 0 }
};