[PATCH] drop-pagecache
Add /proc/sys/vm/drop_caches. When written to, this will cause the kernel to discard as much pagecache and/or reclaimable slab objects as it can. THis operation requires root permissions. It won't drop dirty data, so the user should run `sync' first. Caveats: a) Holds inode_lock for exorbitant amounts of time. b) Needs to be taught about NUMA nodes: propagate these all the way through so the discarding can be controlled on a per-node basis. This is a debugging feature: useful for getting consistent results between filesystem benchmarks. We could possibly put it under a config option, but it's less than 300 bytes. Signed-off-by:Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
Showing
- Documentation/filesystems/proc.txt 17 additions, 0 deletionsDocumentation/filesystems/proc.txt
- Documentation/sysctl/vm.txt 2 additions, 1 deletionDocumentation/sysctl/vm.txt
- fs/Makefile 1 addition, 1 deletionfs/Makefile
- fs/drop_caches.c 68 additions, 0 deletionsfs/drop_caches.c
- include/linux/mm.h 7 additions, 0 deletionsinclude/linux/mm.h
- include/linux/sysctl.h 1 addition, 0 deletionsinclude/linux/sysctl.h
- kernel/sysctl.c 10 additions, 0 deletionskernel/sysctl.c
- mm/truncate.c 0 additions, 1 deletionmm/truncate.c
- mm/vmscan.c 1 addition, 2 deletionsmm/vmscan.c
Loading
Please register or sign in to comment