aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d96ca5bc555b..c6ce20aaf80b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -8005,7 +8005,10 @@ void *__init alloc_large_system_hash(const char *tablename,
8005bool has_unmovable_pages(struct zone *zone, struct page *page, int count, 8005bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
8006 int migratetype, int flags) 8006 int migratetype, int flags)
8007{ 8007{
8008 unsigned long pfn, iter, found; 8008 unsigned long found;
8009 unsigned long iter = 0;
8010 unsigned long pfn = page_to_pfn(page);
8011 const char *reason = "unmovable page";
8009 8012
8010 /* 8013 /*
8011 * TODO we could make this much more efficient by not checking every 8014 * TODO we could make this much more efficient by not checking every
@@ -8015,17 +8018,20 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
8015 * can still lead to having bootmem allocations in zone_movable. 8018 * can still lead to having bootmem allocations in zone_movable.
8016 */ 8019 */
8017 8020
8018 /* 8021 if (is_migrate_cma_page(page)) {
8019 * CMA allocations (alloc_contig_range) really need to mark isolate 8022 /*
8020 * CMA pageblocks even when they are not movable in fact so consider 8023 * CMA allocations (alloc_contig_range) really need to mark
8021 * them movable here. 8024 * isolate CMA pageblocks even when they are not movable in fact
8022 */ 8025 * so consider them movable here.
8023 if (is_migrate_cma(migratetype) && 8026 */
8024 is_migrate_cma(get_pageblock_migratetype(page))) 8027 if (is_migrate_cma(migratetype))
8025 return false; 8028 return false;
8029
8030 reason = "CMA page";
8031 goto unmovable;
8032 }
8026 8033
8027 pfn = page_to_pfn(page); 8034 for (found = 0; iter < pageblock_nr_pages; iter++) {
8028 for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {
8029 unsigned long check = pfn + iter; 8035 unsigned long check = pfn + iter;
8030 8036
8031 if (!pfn_valid_within(check)) 8037 if (!pfn_valid_within(check))
@@ -8105,7 +8111,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
8105unmovable: 8111unmovable:
8106 WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE); 8112 WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE);
8107 if (flags & REPORT_FAILURE) 8113 if (flags & REPORT_FAILURE)
8108 dump_page(pfn_to_page(pfn+iter), "unmovable page"); 8114 dump_page(pfn_to_page(pfn + iter), reason);
8109 return true; 8115 return true;
8110} 8116}
8111 8117