diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2015-04-15 19:15:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:20 -0400 |
commit | 018e9a49a554d915ba945a5faf34c592d65fe575 (patch) | |
tree | d1605bed49e127c8a02144f39f44b079a62da72c /mm | |
parent | be64f884bed729b5d127db6a737155a4e514d286 (diff) |
mm/compaction.c: fix "suitable_migration_target() unused" warning
mm/compaction.c:250:13: warning: 'suitable_migration_target' defined but not used [-Wunused-function]
Reported-by: Fengguang Wu <fengguang.wu@gmail.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/compaction.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index e6c4f9475d43..018f08da99a2 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -391,28 +391,6 @@ static inline bool compact_should_abort(struct compact_control *cc) | |||
391 | return false; | 391 | return false; |
392 | } | 392 | } |
393 | 393 | ||
394 | /* Returns true if the page is within a block suitable for migration to */ | ||
395 | static bool suitable_migration_target(struct page *page) | ||
396 | { | ||
397 | /* If the page is a large free page, then disallow migration */ | ||
398 | if (PageBuddy(page)) { | ||
399 | /* | ||
400 | * We are checking page_order without zone->lock taken. But | ||
401 | * the only small danger is that we skip a potentially suitable | ||
402 | * pageblock, so it's not worth to check order for valid range. | ||
403 | */ | ||
404 | if (page_order_unsafe(page) >= pageblock_order) | ||
405 | return false; | ||
406 | } | ||
407 | |||
408 | /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */ | ||
409 | if (migrate_async_suitable(get_pageblock_migratetype(page))) | ||
410 | return true; | ||
411 | |||
412 | /* Otherwise skip the block */ | ||
413 | return false; | ||
414 | } | ||
415 | |||
416 | /* | 394 | /* |
417 | * Isolate free pages onto a private freelist. If @strict is true, will abort | 395 | * Isolate free pages onto a private freelist. If @strict is true, will abort |
418 | * returning 0 on any invalid PFNs or non-free pages inside of the pageblock | 396 | * returning 0 on any invalid PFNs or non-free pages inside of the pageblock |
@@ -896,6 +874,29 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, | |||
896 | 874 | ||
897 | #endif /* CONFIG_COMPACTION || CONFIG_CMA */ | 875 | #endif /* CONFIG_COMPACTION || CONFIG_CMA */ |
898 | #ifdef CONFIG_COMPACTION | 876 | #ifdef CONFIG_COMPACTION |
877 | |||
878 | /* Returns true if the page is within a block suitable for migration to */ | ||
879 | static bool suitable_migration_target(struct page *page) | ||
880 | { | ||
881 | /* If the page is a large free page, then disallow migration */ | ||
882 | if (PageBuddy(page)) { | ||
883 | /* | ||
884 | * We are checking page_order without zone->lock taken. But | ||
885 | * the only small danger is that we skip a potentially suitable | ||
886 | * pageblock, so it's not worth to check order for valid range. | ||
887 | */ | ||
888 | if (page_order_unsafe(page) >= pageblock_order) | ||
889 | return false; | ||
890 | } | ||
891 | |||
892 | /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */ | ||
893 | if (migrate_async_suitable(get_pageblock_migratetype(page))) | ||
894 | return true; | ||
895 | |||
896 | /* Otherwise skip the block */ | ||
897 | return false; | ||
898 | } | ||
899 | |||
899 | /* | 900 | /* |
900 | * Based on information in the current compact_control, find blocks | 901 | * Based on information in the current compact_control, find blocks |
901 | * suitable for isolating free pages from and then isolate them. | 902 | * suitable for isolating free pages from and then isolate them. |