From: Christoph Lameter proc support for zone reclaim This patch creates a proc entry /proc/sys/vm/zone_reclaim_mode that may be used to override the automatic determination of the zone reclaim made on bootup. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton --- Documentation/sysctl/vm.txt | 18 ++++++++++++++++++ include/linux/sysctl.h | 1 + kernel/sysctl.c | 11 +++++++++++ 3 files changed, 30 insertions(+) diff -puN Documentation/sysctl/vm.txt~zone-reclaim-proc-override Documentation/sysctl/vm.txt --- 25/Documentation/sysctl/vm.txt~zone-reclaim-proc-override Fri Jan 13 17:53:56 2006 +++ 25-akpm/Documentation/sysctl/vm.txt Fri Jan 13 17:53:56 2006 @@ -27,6 +27,7 @@ Currently, these files are in /proc/sys/ - laptop_mode - block_dump - drop-caches +- zone_reclaim_mode ============================================================== @@ -120,3 +121,20 @@ set to pcp->high/4. The upper limit of The initial value is zero. Kernel does not use this value at boot time to set the high water marks for each per cpu page list. + +=============================================================== + +zone_reclaim_mode: + +This is set during bootup to 1 if it is determined that pages from +remote zones will cause a significant performance reduction. The +page allocator will then reclaim easily reusable pages (those page +cache pages that are currently not used) before going off node. + +The user can override this setting. It may be beneficial to switch +off zone reclaim if the system is used for a file server and all +of memory should be used for caching files from disk. + +It may be beneficial to switch this on if one wants to do zone +reclaim regardless of the numa distances in the system. + diff -puN include/linux/sysctl.h~zone-reclaim-proc-override include/linux/sysctl.h --- 25/include/linux/sysctl.h~zone-reclaim-proc-override Fri Jan 13 17:53:56 2006 +++ 25-akpm/include/linux/sysctl.h Fri Jan 13 17:53:56 2006 @@ -182,6 +182,7 @@ enum VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */ VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */ VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ + VM_ZONE_RECLAIM_MODE=31,/* reclaim local zone memory before going off node */ }; diff -puN kernel/sysctl.c~zone-reclaim-proc-override kernel/sysctl.c --- 25/kernel/sysctl.c~zone-reclaim-proc-override Fri Jan 13 17:53:56 2006 +++ 25-akpm/kernel/sysctl.c Fri Jan 13 17:53:56 2006 @@ -870,6 +870,17 @@ static ctl_table vm_table[] = { .strategy = &sysctl_jiffies, }, #endif +#ifdef CONFIG_NUMA + { + .ctl_name = VM_ZONE_RECLAIM_MODE, + .procname = "zone_reclaim_mode", + .data = &zone_reclaim_mode, + .maxlen = sizeof(zone_reclaim_mode), + .mode = 0644, + .proc_handler = &proc_dointvec, + .strategy = &zero, + }, +#endif { .ctl_name = 0 } }; _