===================================================================
--- kernel-2.6.28.orig/mm/vmscan.c
+++ kernel-2.6.28/mm/vmscan.c
-@@ -52,6 +52,12 @@ struct scan_control {
- /* Incremented by the number of inactive pages that were scanned */
- unsigned long nr_scanned;
-
-+ /* Number of pages freed so far during a call to shrink_zones() */
-+ unsigned long nr_reclaimed;
-+
-+ /* How many pages shrink_list() should reclaim */
-+ unsigned long nr_to_reclaim;
-+
- /* This context's GFP mask */
- gfp_t gfp_mask;
-
-@@ -72,6 +78,12 @@ struct scan_control {
+@@ -72,6 +72,12 @@ struct scan_control {
int order;
/* Which cgroup do we reclaim from */
struct mem_cgroup *mem_cgroup;
-@@ -549,7 +561,6 @@ void putback_lru_page(struct page *page)
+@@ -549,7 +555,6 @@ void putback_lru_page(struct page *page)
}
#endif /* CONFIG_UNEVICTABLE_LRU */
/*
* shrink_page_list() returns the number of reclaimed pages
*/
-@@ -613,8 +624,10 @@ static unsigned long shrink_page_list(st
-
- referenced = page_referenced(page, 1, sc->mem_cgroup);
- /* In active use or really unfreeable? Activate it. */
-- if (sc->order <= PAGE_ALLOC_COSTLY_ORDER &&
-- referenced && page_mapping_inuse(page))
-+ if ( ( sc->order <= PAGE_ALLOC_COSTLY_ORDER &&
-+ referenced && page_mapping_inuse(page)
-+ ) || sc->lumpy_reclaim_mode /* ignore refrences in lumpy reclaim mode */
-+ )
- goto activate_locked;
-
- #ifdef CONFIG_SWAP
-@@ -1024,6 +1037,47 @@ int isolate_lru_page(struct page *page)
+@@ -1024,6 +1029,47 @@ int isolate_lru_page(struct page *page)
}
/*
* shrink_inactive_list() is a helper for shrink_zone(). It returns the number
* of reclaimed pages
*/
-@@ -1047,7 +1101,7 @@ static unsigned long shrink_inactive_lis
- unsigned long nr_freed;
- unsigned long nr_active;
- unsigned int count[NR_LRU_LISTS] = { 0, };
-- int mode = ISOLATE_INACTIVE;
-+ int mode = sc->lumpy_reclaim_mode ? ISOLATE_BOTH : ISOLATE_INACTIVE;
-
- /*
- * If we need a large contiguous chunk of memory, or have
-@@ -1088,15 +1142,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);
/*
* The attempt at page out may have made some
-@@ -1404,6 +1451,20 @@ static void get_scan_ratio(struct zone *
+@@ -1404,6 +1443,20 @@ static void get_scan_ratio(struct zone *
percent[1] = 100 - percent[0];
}
/*
* This is a basic per-zone page freer. Used by both kswapd and direct reclaim.
-@@ -1419,6 +1480,8 @@ static unsigned long shrink_zone(int pri
+@@ -1419,6 +1472,8 @@ static unsigned long shrink_zone(int pri
get_scan_ratio(zone, sc, percent);