From d9361da6db436b928179dd9a3f9e72df49393209 Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Thu, 13 Jan 2011 15:45:59 -0800 Subject: [PATCH] --- yaml --- r: 230715 b: refs/heads/master c: 9927af740b1b9b1e769310bd0b91425e8047b803 h: refs/heads/master i: 230713: 3f83cc06f1e3dbf5001219d97422a5fa1d956728 230711: 005b693dce40c9d880e4638dbb72eab835a828ed v: v3 --- [refs] | 2 +- trunk/mm/compaction.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 8ce9fd6dd4ec..1f1d60ecce97 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7f0f24967b0349798803260b2e4bf347cffa1990 +refs/heads/master: 9927af740b1b9b1e769310bd0b91425e8047b803 diff --git a/trunk/mm/compaction.c b/trunk/mm/compaction.c index e005a30e968c..b0fbfdfad298 100644 --- a/trunk/mm/compaction.c +++ b/trunk/mm/compaction.c @@ -240,6 +240,7 @@ static unsigned long isolate_migratepages(struct zone *zone, struct compact_control *cc) { unsigned long low_pfn, end_pfn; + unsigned long last_pageblock_nr = 0, pageblock_nr; unsigned long nr_scanned = 0, nr_isolated = 0; struct list_head *migratelist = &cc->migratepages; @@ -280,6 +281,20 @@ static unsigned long isolate_migratepages(struct zone *zone, if (PageBuddy(page)) continue; + /* + * For async migration, also only scan in MOVABLE blocks. Async + * migration is optimistic to see if the minimum amount of work + * satisfies the allocation + */ + pageblock_nr = low_pfn >> pageblock_order; + if (!cc->sync && last_pageblock_nr != pageblock_nr && + get_pageblock_migratetype(page) != MIGRATE_MOVABLE) { + low_pfn += pageblock_nr_pages; + low_pfn = ALIGN(low_pfn, pageblock_nr_pages) - 1; + last_pageblock_nr = pageblock_nr; + continue; + } + /* Try isolate the page */ if (__isolate_lru_page(page, ISOLATE_BOTH, 0) != 0) continue;