Before we try to isolate physically contiguous pages, check for page order is
added, and if the reclaim order is no larger than page order, we should give up
the attempt.
Signed-off-by: Hillf Danton<dhillf@xxxxxxxxx>
Cc: Michal Hocko<mhocko@xxxxxxx>
Cc: KAMEZAWA Hiroyuki<kamezawa.hiroyu@xxxxxxxxxxxxxx>
Cc: Andrew Morton<akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: David Rientjes<rientjes@xxxxxxxxxx>
Cc: Hugh Dickins<hughd@xxxxxxxxxx>
---
--- a/mm/vmscan.c Thu Dec 29 20:20:16 2011
+++ b/mm/vmscan.c Thu Dec 29 20:28:14 2011
@@ -1162,6 +1162,7 @@ static unsigned long isolate_lru_pages(u
unsigned long end_pfn;
unsigned long page_pfn;
int zone_id;
+ unsigned int isolated_pages = 0;
page = lru_to_page(src);
prefetchw_prev_lru_page(page, src, flags);
@@ -1172,7 +1173,7 @@ static unsigned long isolate_lru_pages(u
case 0:
mem_cgroup_lru_del(page);
list_move(&page->lru, dst);
- nr_taken += hpage_nr_pages(page);
+ isolated_pages = hpage_nr_pages(page);
break;
case -EBUSY:
@@ -1184,8 +1185,11 @@ static unsigned long isolate_lru_pages(u
BUG();
}
+ nr_taken += isolated_pages;
if (!order)
continue;
+ if (isolated_pages != 1&& isolated_pages>= (1<< order))
+ continue;