1 From d620f695290e4ffb1586420ba1dbbb5b2c8c075d Mon Sep 17 00:00:00 2001
2 From: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
3 Date: Tue, 17 Feb 2009 14:51:02 -0800
4 Subject: [PATCH 055/134] mm: Add min_free_order_shift tunable.
6 Content-Type: text/plain; charset=utf-8
7 Content-Transfer-Encoding: 8bit
9 By default the kernel tries to keep half as much memory free at each
10 order as it does for one order below. This can be too agressive when
13 Signed-off-by: Arve Hjønnevåg <arve@android.com>
15 kernel/sysctl.c | 9 +++++++++
16 mm/page_alloc.c | 3 ++-
17 2 files changed, 11 insertions(+), 1 deletions(-)
21 @@ -77,6 +77,7 @@ extern int suid_dumpable;
22 extern char core_pattern[];
24 extern int min_free_kbytes;
25 +extern int min_free_order_shift;
26 extern int pid_max_min, pid_max_max;
27 extern int sysctl_drop_caches;
28 extern int percpu_pagelist_fraction;
29 @@ -1138,6 +1139,14 @@ static struct ctl_table vm_table[] = {
33 + .ctl_name = CTL_UNNUMBERED,
34 + .procname = "min_free_order_shift",
35 + .data = &min_free_order_shift,
36 + .maxlen = sizeof(min_free_order_shift),
38 + .proc_handler = &proc_dointvec
41 .ctl_name = VM_PERCPU_PAGELIST_FRACTION,
42 .procname = "percpu_pagelist_fraction",
43 .data = &percpu_pagelist_fraction,
46 @@ -119,6 +119,7 @@ static char * const zone_names[MAX_NR_ZO
49 int min_free_kbytes = 1024;
50 +int min_free_order_shift = 1;
52 unsigned long __meminitdata nr_kernel_pages;
53 unsigned long __meminitdata nr_all_pages;
54 @@ -1258,7 +1259,7 @@ int zone_watermark_ok(struct zone *z, in
55 free_pages -= z->free_area[o].nr_free << o;
57 /* Require fewer higher order pages to be free */
59 + min >>= min_free_order_shift;
61 if (free_pages <= min)