From: Arve Hjønnevåg Date: Tue, 17 Feb 2009 22:51:02 +0000 (-0800) Subject: mm: Add min_free_order_shift tunable. X-Git-Tag: firefly_0821_release~4090^2~884 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6df890364b72edc57fb74aa0f59668450fa678ff;p=firefly-linux-kernel-4.4.55.git mm: Add min_free_order_shift tunable. By default the kernel tries to keep half as much memory free at each order as it does for one order below. This can be too agressive when running without swap. Change-Id: I5efc1a0b50f41ff3ac71e92d2efd175dedd54ead Signed-off-by: Arve Hjønnevåg --- diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 9edcf456e0fc..1a07798c9146 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -105,6 +105,7 @@ extern char core_pattern[]; extern unsigned int core_pipe_limit; #endif extern int pid_max; +extern int min_free_order_shift; extern int pid_max_min, pid_max_max; extern int percpu_pagelist_fraction; extern int compat_log; @@ -1265,6 +1266,13 @@ static struct ctl_table vm_table[] = { .proc_handler = min_free_kbytes_sysctl_handler, .extra1 = &zero, }, + { + .procname = "min_free_order_shift", + .data = &min_free_order_shift, + .maxlen = sizeof(min_free_order_shift), + .mode = 0644, + .proc_handler = &proc_dointvec + }, { .procname = "percpu_pagelist_fraction", .data = &percpu_pagelist_fraction, diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c3edb624fccf..58f55f605ad3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -197,6 +197,7 @@ static char * const zone_names[MAX_NR_ZONES] = { }; int min_free_kbytes = 1024; +int min_free_order_shift = 1; static unsigned long __meminitdata nr_kernel_pages; static unsigned long __meminitdata nr_all_pages; @@ -1648,7 +1649,7 @@ static bool __zone_watermark_ok(struct zone *z, int order, unsigned long mark, free_pages -= z->free_area[o].nr_free << o; /* Require fewer higher order pages to be free */ - min >>= 1; + min >>= min_free_order_shift; if (free_pages <= min) return false;