diff options
-rw-r--r-- | kernel/sysctl.c | 8 | ||||
-rw-r--r-- | mm/page_alloc.c | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f88552c6d227..aadaee9bcb18 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -94,6 +94,7 @@ extern char core_pattern[]; extern unsigned int core_pipe_limit; extern int pid_max; extern int min_free_kbytes; +extern int min_free_order_shift; extern int pid_max_min, pid_max_max; extern int sysctl_drop_caches; extern int percpu_pagelist_fraction; @@ -1157,6 +1158,13 @@ static struct ctl_table vm_table[] = { .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, .maxlen = sizeof(percpu_pagelist_fraction), diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a8cfa9cc6e86..17ce3faeecca 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -166,6 +166,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; @@ -1477,7 +1478,7 @@ int 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 0; |