Skip to contentSkip to conversation

aa-093-vm_tunables

PATCH Andrew Morton 1 participant 1 message Mar 20, 2002

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

Introduces a bunch of knobs for tuning the VM. They're described in the patch.

They are not actually *used* in this patch. The usage creeps in across subsequent patches.

It's probable that the default icache shrinkage here is insufficiently aggressive - Al says we should shrink inode_unused with extreme prejudice - priority == 1.

It's possible that the default dcache shrinkage is too aggressive. We're shrinking the dcache by 1/6th for every 32 pages which are added to the swapcache. Restoring those dcache/icache entries will be much, much more expensive than swapping in 32 pages. So it's out of whack. I've left it as-is at present; choosing a suitable default for the shrink_dcache_memory priority is on my immediate things-to-do list.

=====================================

include/linux/swap.h renamed from include/linux/swap.h~aa-093-vm_tunables +1 -0
@@ -112,6 +112,7 @@ extern void swap_setup(void);
 /* linux/mm/vmscan.c */
 extern wait_queue_head_t kswapd_wait;
 extern int FASTCALL(try_to_free_pages(zone_t *, unsigned int, unsigned int));
+extern int vm_vfs_scan_ratio, vm_cache_scan_ratio, vm_lru_balance_ratio, vm_passes, vm_gfp_debug, vm_mapped_ratio;
 
 /* linux/mm/page_io.c */
 extern void rw_swap_page(int, struct page *);
include/linux/sysctl.h renamed from include/linux/sysctl.h~aa-093-vm_tunables +6 -0
@@ -143,6 +143,12 @@ enum
 	VM_MAX_MAP_COUNT=11,	/* int: Maximum number of active map areas */
 	VM_MIN_READAHEAD=12,    /* Min file readahead */
 	VM_MAX_READAHEAD=13,    /* Max file readahead */
+	VM_VFS_SCAN_RATIO=14,	/* part of the inactive vfs lists to scan */
+	VM_LRU_BALANCE_RATIO=15,/* balance active and inactive caches */
+	VM_PASSES=16,		/* number of vm passes before failing */
+	VM_GFP_DEBUG=17,	/* debug GFP failures */
+	VM_CACHE_SCAN_RATIO=18,	/* part of the inactive cache list to scan */
+	VM_MAPPED_RATIO=19,	/* amount of unfreeable pages that triggers swapout */
 };
 
 
kernel/sysctl.c renamed from kernel/sysctl.c~aa-093-vm_tunables +13 -0
@@ -30,6 +30,7 @@
 #include <linux/init.h>
 #include <linux/sysrq.h>
 #include <linux/highuid.h>
+#include <linux/swap.h>
 
 #include <asm/uaccess.h>
 
@@ -260,6 +261,18 @@ static ctl_table kern_table[] = {
 };
 
 static ctl_table vm_table[] = {
+	{VM_GFP_DEBUG, "vm_gfp_debug", 
+	 &vm_gfp_debug, sizeof(int), 0644, NULL, &proc_dointvec},
+	{VM_VFS_SCAN_RATIO, "vm_vfs_scan_ratio", 
+	 &vm_vfs_scan_ratio, sizeof(int), 0644, NULL, &proc_dointvec},
+	{VM_CACHE_SCAN_RATIO, "vm_cache_scan_ratio", 
+	 &vm_cache_scan_ratio, sizeof(int), 0644, NULL, &proc_dointvec},
+	{VM_MAPPED_RATIO, "vm_mapped_ratio", 
+	 &vm_mapped_ratio, sizeof(int), 0644, NULL, &proc_dointvec},
+	{VM_LRU_BALANCE_RATIO, "vm_lru_balance_ratio", 
+	 &vm_lru_balance_ratio, sizeof(int), 0644, NULL, &proc_dointvec},
+	{VM_PASSES, "vm_passes", 
+	 &vm_passes, sizeof(int), 0644, NULL, &proc_dointvec},
 	{VM_BDFLUSH, "bdflush", &bdf_prm, 9*sizeof(int), 0644, NULL,
 	 &proc_dointvec_minmax, &sysctl_intvec, NULL,
 	 &bdflush_min, &bdflush_max},
mm/vmscan.c renamed from mm/vmscan.c~aa-093-vm_tunables +37 -7

63 lines not on this page · raw message

mm/page_alloc.c renamed from mm/page_alloc.c~aa-093-vm_tunables +2 -0
@@ -39,6 +39,8 @@ static int zone_balance_ratio[MAX_NR_ZON
 static int zone_balance_min[MAX_NR_ZONES] __initdata = { 20 , 20, 20, };
 static int zone_balance_max[MAX_NR_ZONES] __initdata = { 255 , 255, 255, };
 
+int vm_gfp_debug = 0;
+
 /*
  * Free_page() adds the page to the free lists. This is optimized for
  * fast normal cases (no error jumps taken normally).

-