diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 47e98423b30d..cf913bdd433e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2005,6 +2005,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat, | |||
2005 | #ifdef CONFIG_NUMA | 2005 | #ifdef CONFIG_NUMA |
2006 | zone->min_unmapped_pages = (realsize*sysctl_min_unmapped_ratio) | 2006 | zone->min_unmapped_pages = (realsize*sysctl_min_unmapped_ratio) |
2007 | / 100; | 2007 | / 100; |
2008 | zone->min_slab_pages = (realsize * sysctl_min_slab_ratio) / 100; | ||
2008 | #endif | 2009 | #endif |
2009 | zone->name = zone_names[j]; | 2010 | zone->name = zone_names[j]; |
2010 | spin_lock_init(&zone->lock); | 2011 | spin_lock_init(&zone->lock); |
@@ -2318,6 +2319,22 @@ int sysctl_min_unmapped_ratio_sysctl_handler(ctl_table *table, int write, | |||
2318 | sysctl_min_unmapped_ratio) / 100; | 2319 | sysctl_min_unmapped_ratio) / 100; |
2319 | return 0; | 2320 | return 0; |
2320 | } | 2321 | } |
2322 | |||
2323 | int sysctl_min_slab_ratio_sysctl_handler(ctl_table *table, int write, | ||
2324 | struct file *file, void __user *buffer, size_t *length, loff_t *ppos) | ||
2325 | { | ||
2326 | struct zone *zone; | ||
2327 | int rc; | ||
2328 | |||
2329 | rc = proc_dointvec_minmax(table, write, file, buffer, length, ppos); | ||
2330 | if (rc) | ||
2331 | return rc; | ||
2332 | |||
2333 | for_each_zone(zone) | ||
2334 | zone->min_slab_pages = (zone->present_pages * | ||
2335 | sysctl_min_slab_ratio) / 100; | ||
2336 | return 0; | ||
2337 | } | ||
2321 | #endif | 2338 | #endif |
2322 | 2339 | ||
2323 | /* | 2340 | /* |