diff options
author | Vlastimil Babka <vbabka@suse.cz> | 2017-05-08 18:54:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-08 20:15:10 -0400 |
commit | b682debd97153706ffbe2fe3f8ec30a7ee11f9e1 (patch) | |
tree | a9a67706b3a0323668049eb7dd2929893a75664c /mm/compaction.c | |
parent | 02aa0cdd72483c6dd436ed24d1000f86e0038d28 (diff) |
mm, compaction: change migrate_async_suitable() to suitable_migration_source()
Preparation for making the decisions more complex and depending on
compact_control flags. No functional change.
Link: http://lkml.kernel.org/r/20170307131545.28577-6-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-rw-r--r-- | mm/compaction.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 01b1fb8f6f47..a20876e37648 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -89,11 +89,6 @@ static void map_pages(struct list_head *list) | |||
89 | list_splice(&tmp_list, list); | 89 | list_splice(&tmp_list, list); |
90 | } | 90 | } |
91 | 91 | ||
92 | static inline bool migrate_async_suitable(int migratetype) | ||
93 | { | ||
94 | return is_migrate_cma(migratetype) || migratetype == MIGRATE_MOVABLE; | ||
95 | } | ||
96 | |||
97 | #ifdef CONFIG_COMPACTION | 92 | #ifdef CONFIG_COMPACTION |
98 | 93 | ||
99 | int PageMovable(struct page *page) | 94 | int PageMovable(struct page *page) |
@@ -988,6 +983,15 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, | |||
988 | #endif /* CONFIG_COMPACTION || CONFIG_CMA */ | 983 | #endif /* CONFIG_COMPACTION || CONFIG_CMA */ |
989 | #ifdef CONFIG_COMPACTION | 984 | #ifdef CONFIG_COMPACTION |
990 | 985 | ||
986 | static bool suitable_migration_source(struct compact_control *cc, | ||
987 | struct page *page) | ||
988 | { | ||
989 | if (cc->mode != MIGRATE_ASYNC) | ||
990 | return true; | ||
991 | |||
992 | return is_migrate_movable(get_pageblock_migratetype(page)); | ||
993 | } | ||
994 | |||
991 | /* Returns true if the page is within a block suitable for migration to */ | 995 | /* Returns true if the page is within a block suitable for migration to */ |
992 | static bool suitable_migration_target(struct compact_control *cc, | 996 | static bool suitable_migration_target(struct compact_control *cc, |
993 | struct page *page) | 997 | struct page *page) |
@@ -1007,7 +1011,7 @@ static bool suitable_migration_target(struct compact_control *cc, | |||
1007 | return true; | 1011 | return true; |
1008 | 1012 | ||
1009 | /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */ | 1013 | /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */ |
1010 | if (migrate_async_suitable(get_pageblock_migratetype(page))) | 1014 | if (is_migrate_movable(get_pageblock_migratetype(page))) |
1011 | return true; | 1015 | return true; |
1012 | 1016 | ||
1013 | /* Otherwise skip the block */ | 1017 | /* Otherwise skip the block */ |
@@ -1242,8 +1246,7 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, | |||
1242 | * Async compaction is optimistic to see if the minimum amount | 1246 | * Async compaction is optimistic to see if the minimum amount |
1243 | * of work satisfies the allocation. | 1247 | * of work satisfies the allocation. |
1244 | */ | 1248 | */ |
1245 | if (cc->mode == MIGRATE_ASYNC && | 1249 | if (!suitable_migration_source(cc, page)) |
1246 | !migrate_async_suitable(get_pageblock_migratetype(page))) | ||
1247 | continue; | 1250 | continue; |
1248 | 1251 | ||
1249 | /* Perform the isolation */ | 1252 | /* Perform the isolation */ |