2c6e32952759e3b5a4361f8c22d4cfa52b13bb00
[openwrt.git] / target / linux / goldfish / patches-2.6.30 / 0055-mm-Add-min_free_order_shift-tunable.patch
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.
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=utf-8
7 Content-Transfer-Encoding: 8bit
8
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
11 running without swap.
12
13 Signed-off-by: Arve Hjønnevåg <arve@android.com>
14 ---
15 kernel/sysctl.c | 9 +++++++++
16 mm/page_alloc.c | 3 ++-
17 2 files changed, 11 insertions(+), 1 deletions(-)
18
19 --- a/kernel/sysctl.c
20 +++ b/kernel/sysctl.c
21 @@ -77,6 +77,7 @@ extern int suid_dumpable;
22 extern char core_pattern[];
23 extern int pid_max;
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 @@ -1109,6 +1110,14 @@ static struct ctl_table vm_table[] = {
30 .extra1 = &zero,
31 },
32 {
33 + .ctl_name = CTL_UNNUMBERED,
34 + .procname = "min_free_order_shift",
35 + .data = &min_free_order_shift,
36 + .maxlen = sizeof(min_free_order_shift),
37 + .mode = 0644,
38 + .proc_handler = &proc_dointvec
39 + },
40 + {
41 .ctl_name = VM_PERCPU_PAGELIST_FRACTION,
42 .procname = "percpu_pagelist_fraction",
43 .data = &percpu_pagelist_fraction,
44 --- a/mm/page_alloc.c
45 +++ b/mm/page_alloc.c
46 @@ -119,6 +119,7 @@ static char * const zone_names[MAX_NR_ZO
47 };
48
49 int min_free_kbytes = 1024;
50 +int min_free_order_shift = 1;
51
52 unsigned long __meminitdata nr_kernel_pages;
53 unsigned long __meminitdata nr_all_pages;
54 @@ -1253,7 +1254,7 @@ int zone_watermark_ok(struct zone *z, in
55 free_pages -= z->free_area[o].nr_free << o;
56
57 /* Require fewer higher order pages to be free */
58 - min >>= 1;
59 + min >>= min_free_order_shift;
60
61 if (free_pages <= min)
62 return 0;
This page took 0.041737 seconds and 3 git commands to generate.