Whamcloud - gitweb
7e4a9d615e30ab8ece44e3d889bc392a13784c38
[fs/lustre-release.git] / lustre / kernel_patches / patches / vm-tunables-rhel4.patch
1 Index: linux+rhel4+chaos/mm/page_alloc.c
2 ===================================================================
3 --- linux+rhel4+chaos.orig/mm/page_alloc.c
4 +++ linux+rhel4+chaos/mm/page_alloc.c
5 @@ -1972,8 +1972,12 @@ static void setup_per_zone_pages_min(voi
6                                            lowmem_pages;
7                 }
8  
9 -               zone->pages_low = zone->pages_min * 2;
10 -               zone->pages_high = zone->pages_min * 3;
11 +               /*
12 +                * When interpreting these watermarks, just keep in mind that:
13 +                * zone->pages_min == (zone->pages_min * 4) / 4;
14 +                */
15 +               zone->pages_low  = (zone->pages_min * 5) / 4;
16 +               zone->pages_high = (zone->pages_min * 6) / 4;
17                 spin_unlock_irqrestore(&zone->lru_lock, flags);
18         }
19  }
20 @@ -1982,24 +1986,25 @@ static void setup_per_zone_pages_min(voi
21   * Initialise min_free_kbytes.
22   *
23   * For small machines we want it small (128k min).  For large machines
24 - * we want it large (16MB max).  But it is not linear, because network
25 + * we want it large (64MB max).  But it is not linear, because network
26   * bandwidth does not increase linearly with machine size.  We use
27   *
28 - *     min_free_kbytes = sqrt(lowmem_kbytes)
29 + *     min_free_kbytes = 4 * sqrt(lowmem_kbytes), for better accuracy
30 + *  min_free_kbytes = sqrt(lowmem_kbytes * 16) 
31   *
32   * which yields
33   *
34 - * 16MB:       128k
35 - * 32MB:       181k
36 - * 64MB:       256k
37 - * 128MB:      362k
38 - * 256MB:      512k
39 - * 512MB:      724k
40 - * 1024MB:     1024k
41 - * 2048MB:     1448k
42 - * 4096MB:     2048k
43 - * 8192MB:     2896k
44 - * 16384MB:    4096k
45 + * 16MB:       512k
46 + * 32MB:       724k
47 + * 64MB:       1024k
48 + * 128MB:      1448k
49 + * 256MB:      2048k
50 + * 512MB:      2896k
51 + * 1024MB:     4096k
52 + * 2048MB:     5792k
53 + * 4096MB:     8192k
54 + * 8192MB:     11584k
55 + * 16384MB:    16384k
56   */
57  static int __init init_per_zone_pages_min(void)
58  {
59 @@ -2007,11 +2012,11 @@ static int __init init_per_zone_pages_mi
60  
61         lowmem_kbytes = nr_free_buffer_pages() * (PAGE_SIZE >> 10);
62  
63 -       min_free_kbytes = int_sqrt(lowmem_kbytes);
64 +       min_free_kbytes = int_sqrt(lowmem_kbytes * 16);
65         if (min_free_kbytes < 128)
66                 min_free_kbytes = 128;
67 -       if (min_free_kbytes > 16384)
68 -               min_free_kbytes = 16384;
69 +       if (min_free_kbytes > 65536)
70 +               min_free_kbytes = 65536;
71         setup_per_zone_pages_min();
72         setup_per_zone_protection();
73         return 0;