removing using of the lumpy_reclaim_mode in several cases
[kernel-bfs] / kernel-power-2.6.28 / debian / patches / issue_12309_0.diff
index fb2db00..3dd6f61 100644 (file)
@@ -76,7 +76,28 @@ Index: kernel-2.6.28/mm/vmscan.c
 ===================================================================
 --- kernel-2.6.28.orig/mm/vmscan.c
 +++ kernel-2.6.28/mm/vmscan.c
-@@ -1024,6 +1024,47 @@ int isolate_lru_page(struct page *page)
+@@ -72,6 +72,12 @@ struct scan_control {
+       int order;
++      /*
++       * Intend to reclaim enough contenious memory rather than to reclaim
++       * enough amount memory. I.e, it's the mode for high order allocation.
++       */
++      bool lumpy_reclaim_mode;
++
+       /* Which cgroup do we reclaim from */
+       struct mem_cgroup *mem_cgroup;
+@@ -549,7 +555,6 @@ void putback_lru_page(struct page *page)
+ }
+ #endif /* CONFIG_UNEVICTABLE_LRU */
+-
+ /*
+  * shrink_page_list() returns the number of reclaimed pages
+  */
+@@ -1024,6 +1029,47 @@ int isolate_lru_page(struct page *page)
  }
  
  /*
@@ -124,7 +145,7 @@ Index: kernel-2.6.28/mm/vmscan.c
   * shrink_inactive_list() is a helper for shrink_zone().  It returns the number
   * of reclaimed pages
   */
-@@ -1088,15 +1129,8 @@ static unsigned long shrink_inactive_lis
+@@ -1088,15 +1134,8 @@ static unsigned long shrink_inactive_lis
                nr_scanned += nr_scan;
                nr_freed = shrink_page_list(&page_list, sc, PAGEOUT_IO_ASYNC);
  
@@ -142,3 +163,33 @@ Index: kernel-2.6.28/mm/vmscan.c
  
                        /*
                         * The attempt at page out may have made some
+@@ -1404,6 +1443,20 @@ static void get_scan_ratio(struct zone *
+       percent[1] = 100 - percent[0];
+ }
++static void set_lumpy_reclaim_mode(int priority, struct scan_control *sc)
++{
++      /*
++       * If we need a large contiguous chunk of memory, or have
++       * trouble getting a small set of contiguous pages, we
++       * will reclaim both active and inactive pages.
++       */
++      if (sc->order > PAGE_ALLOC_COSTLY_ORDER)
++              sc->lumpy_reclaim_mode = 1;
++      else if (sc->order && priority < DEF_PRIORITY - 2)
++              sc->lumpy_reclaim_mode = 1;
++      else
++              sc->lumpy_reclaim_mode = 0;
++}
+ /*
+  * This is a basic per-zone page freer.  Used by both kswapd and direct reclaim.
+@@ -1419,6 +1472,8 @@ static unsigned long shrink_zone(int pri
+       get_scan_ratio(zone, sc, percent);
++      set_lumpy_reclaim_mode(priority, sc);
++
+       for_each_evictable_lru(l) {
+               if (scan_global_lru(sc)) {
+                       int file = is_file_lru(l);