|
@@ -89,11 +89,6 @@ static void map_pages(struct list_head *list)
|
|
list_splice(&tmp_list, list);
|
|
list_splice(&tmp_list, list);
|
|
}
|
|
}
|
|
|
|
|
|
-static inline bool migrate_async_suitable(int migratetype)
|
|
|
|
-{
|
|
|
|
- return is_migrate_cma(migratetype) || migratetype == MIGRATE_MOVABLE;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
#ifdef CONFIG_COMPACTION
|
|
#ifdef CONFIG_COMPACTION
|
|
|
|
|
|
int PageMovable(struct page *page)
|
|
int PageMovable(struct page *page)
|
|
@@ -988,6 +983,15 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn,
|
|
#endif /* CONFIG_COMPACTION || CONFIG_CMA */
|
|
#endif /* CONFIG_COMPACTION || CONFIG_CMA */
|
|
#ifdef CONFIG_COMPACTION
|
|
#ifdef CONFIG_COMPACTION
|
|
|
|
|
|
|
|
+static bool suitable_migration_source(struct compact_control *cc,
|
|
|
|
+ struct page *page)
|
|
|
|
+{
|
|
|
|
+ if (cc->mode != MIGRATE_ASYNC)
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ return is_migrate_movable(get_pageblock_migratetype(page));
|
|
|
|
+}
|
|
|
|
+
|
|
/* Returns true if the page is within a block suitable for migration to */
|
|
/* Returns true if the page is within a block suitable for migration to */
|
|
static bool suitable_migration_target(struct compact_control *cc,
|
|
static bool suitable_migration_target(struct compact_control *cc,
|
|
struct page *page)
|
|
struct page *page)
|
|
@@ -1007,7 +1011,7 @@ static bool suitable_migration_target(struct compact_control *cc,
|
|
return true;
|
|
return true;
|
|
|
|
|
|
/* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
|
|
/* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */
|
|
- if (migrate_async_suitable(get_pageblock_migratetype(page)))
|
|
|
|
|
|
+ if (is_migrate_movable(get_pageblock_migratetype(page)))
|
|
return true;
|
|
return true;
|
|
|
|
|
|
/* Otherwise skip the block */
|
|
/* Otherwise skip the block */
|
|
@@ -1242,8 +1246,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
|
|
* Async compaction is optimistic to see if the minimum amount
|
|
* Async compaction is optimistic to see if the minimum amount
|
|
* of work satisfies the allocation.
|
|
* of work satisfies the allocation.
|
|
*/
|
|
*/
|
|
- if (cc->mode == MIGRATE_ASYNC &&
|
|
|
|
- !migrate_async_suitable(get_pageblock_migratetype(page)))
|
|
|
|
|
|
+ if (!suitable_migration_source(cc, page))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
/* Perform the isolation */
|
|
/* Perform the isolation */
|