mm/compaction: check pageblock suitability once per pageblock
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>
Thu, 28 Aug 2014 18:34:39 +0000 (19:34 +0100)
committerJiri Slaby <jslaby@suse.cz>
Fri, 26 Sep 2014 09:51:55 +0000 (11:51 +0200)
commitfc8dc0a9f5b062d2b5fbfe368e4d9cdff23ca76b
tree016fa8bd865f8f7701f71b80cb86edf1aa036272
parente45dcd3deabda867dbb5ceb05706d32bb4267d79
mm/compaction: check pageblock suitability once per pageblock

commit c122b2087ab94192f2b937e47b563a9c4e688ece upstream.

isolation_suitable() and migrate_async_suitable() is used to be sure
that this pageblock range is fine to be migragted.  It isn't needed to
call it on every page.  Current code do well if not suitable, but, don't
do well when suitable.

1) It re-checks isolation_suitable() on each page of a pageblock that was
   already estabilished as suitable.
2) It re-checks migrate_async_suitable() on each page of a pageblock that
   was not entered through the next_pageblock: label, because
   last_pageblock_nr is not otherwise updated.

This patch fixes situation by 1) calling isolation_suitable() only once
per pageblock and 2) always updating last_pageblock_nr to the pageblock
that was just checked.

Additionally, move PageBuddy() check after pageblock unit check, since
pageblock check is the first thing we should do and makes things more
simple.

[vbabka@suse.cz: rephrase commit description]
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
mm/compaction.c