aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2014-04-07 18:37:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:35:51 -0400
commit7d348b9ea64db0a315d777ce7d4b06697f946503 (patch)
tree6a2ce9b629b3432328a9f2f6539ea4c57ccc83da
parent70ef57e6c22c3323dce179b7d0d433c479266612 (diff)
mm/compaction: disallow high-order page for migration target
Purpose of compaction is to get a high order page. Currently, if we find high-order page while searching migration target page, we break it to order-0 pages and use them as migration target. It is contrary to purpose of compaction, so disallow high-order page to be used for migration target. Additionally, clean-up logic in suitable_migration_target() to simplify the code. There is no functional changes from this clean-up. 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>
-rw-r--r--mm/compaction.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/mm/compaction.c b/mm/compaction.c
index b6ab77160068..9a03fdb1fd84 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -217,21 +217,12 @@ static inline bool compact_trylock_irqsave(spinlock_t *lock,
217/* Returns true if the page is within a block suitable for migration to */ 217/* Returns true if the page is within a block suitable for migration to */
218static bool suitable_migration_target(struct page *page) 218static bool suitable_migration_target(struct page *page)
219{ 219{
220 int migratetype = get_pageblock_migratetype(page); 220 /* If the page is a large free page, then disallow migration */
221
222 /* Don't interfere with memory hot-remove or the min_free_kbytes blocks */
223 if (migratetype == MIGRATE_RESERVE)
224 return false;
225
226 if (is_migrate_isolate(migratetype))
227 return false;
228
229 /* If the page is a large free page, then allow migration */
230 if (PageBuddy(page) && page_order(page) >= pageblock_order) 221 if (PageBuddy(page) && page_order(page) >= pageblock_order)
231 return true; 222 return false;
232 223
233 /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */ 224 /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
234 if (migrate_async_suitable(migratetype)) 225 if (migrate_async_suitable(get_pageblock_migratetype(page)))
235 return true; 226 return true;
236 227
237 /* Otherwise skip the block */ 228 /* Otherwise skip the block */