Lines Matching refs:cc

221 static inline bool isolation_suitable(struct compact_control *cc,  in isolation_suitable()  argument
224 if (cc->ignore_skip_hint) in isolation_suitable()
402 static bool test_and_set_skip(struct compact_control *cc, struct page *page, in test_and_set_skip() argument
408 if (cc->ignore_skip_hint) in test_and_set_skip()
415 if (!skip && !cc->no_set_skip_hint) in test_and_set_skip()
421 static void update_cached_migrate(struct compact_control *cc, unsigned long pfn) in update_cached_migrate() argument
423 struct zone *zone = cc->zone; in update_cached_migrate()
428 if (cc->no_set_skip_hint) in update_cached_migrate()
433 if (cc->mode != MIGRATE_ASYNC && in update_cached_migrate()
442 static void update_pageblock_skip(struct compact_control *cc, in update_pageblock_skip() argument
445 struct zone *zone = cc->zone; in update_pageblock_skip()
447 if (cc->no_set_skip_hint) in update_pageblock_skip()
460 static inline bool isolation_suitable(struct compact_control *cc, in isolation_suitable() argument
471 static inline void update_pageblock_skip(struct compact_control *cc, in update_pageblock_skip() argument
476 static void update_cached_migrate(struct compact_control *cc, unsigned long pfn) in update_cached_migrate() argument
480 static bool test_and_set_skip(struct compact_control *cc, struct page *page, in test_and_set_skip() argument
497 struct compact_control *cc) in compact_lock_irqsave() argument
501 if (cc->mode == MIGRATE_ASYNC && !cc->contended) { in compact_lock_irqsave()
505 cc->contended = true; in compact_lock_irqsave()
528 unsigned long flags, bool *locked, struct compact_control *cc) in compact_unlock_should_abort() argument
536 cc->contended = true; in compact_unlock_should_abort()
550 static unsigned long isolate_freepages_block(struct compact_control *cc, in isolate_freepages_block() argument
581 && compact_unlock_should_abort(&cc->zone->lock, flags, in isolate_freepages_block()
582 &locked, cc)) in isolate_freepages_block()
614 locked = compact_lock_irqsave(&cc->zone->lock, in isolate_freepages_block()
615 &flags, cc); in isolate_freepages_block()
630 cc->nr_freepages += isolated; in isolate_freepages_block()
633 if (!strict && cc->nr_migratepages <= cc->nr_freepages) { in isolate_freepages_block()
651 spin_unlock_irqrestore(&cc->zone->lock, flags); in isolate_freepages_block()
674 cc->total_free_scanned += nr_scanned; in isolate_freepages_block()
695 isolate_freepages_range(struct compact_control *cc, in isolate_freepages_range() argument
703 if (block_start_pfn < cc->zone->zone_start_pfn) in isolate_freepages_range()
704 block_start_pfn = cc->zone->zone_start_pfn; in isolate_freepages_range()
727 block_end_pfn, cc->zone)) in isolate_freepages_range()
730 isolated = isolate_freepages_block(cc, &isolate_start_pfn, in isolate_freepages_range()
800 isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, in isolate_migratepages_block() argument
803 pg_data_t *pgdat = cc->zone->zone_pgdat; in isolate_migratepages_block()
815 cc->migrate_pfn = low_pfn; in isolate_migratepages_block()
824 if (cc->nr_migratepages) in isolate_migratepages_block()
828 if (cc->mode == MIGRATE_ASYNC) in isolate_migratepages_block()
839 if (cc->direct_compaction && (cc->mode == MIGRATE_ASYNC)) { in isolate_migratepages_block()
841 next_skip_pfn = block_end_pfn(low_pfn, cc->order); in isolate_migratepages_block()
866 next_skip_pfn = block_end_pfn(low_pfn, cc->order); in isolate_migratepages_block()
881 cc->contended = true; in isolate_migratepages_block()
901 if (!cc->ignore_skip_hint && get_pageblock_skip(page)) { in isolate_migratepages_block()
909 if (PageHuge(page) && cc->alloc_contig) { in isolate_migratepages_block()
910 ret = isolate_or_dissolve_huge_page(page, &cc->migratepages); in isolate_migratepages_block()
968 if (PageCompound(page) && !cc->alloc_contig) { in isolate_migratepages_block()
1013 if (!(cc->gfp_mask & __GFP_FS) && page_mapping(page)) in isolate_migratepages_block()
1038 compact_lock_irqsave(&lruvec->lru_lock, &flags, cc); in isolate_migratepages_block()
1046 if (test_and_set_skip(cc, page, low_pfn)) in isolate_migratepages_block()
1055 if (unlikely(PageCompound(page) && !cc->alloc_contig)) { in isolate_migratepages_block()
1073 list_add(&page->lru, &cc->migratepages); in isolate_migratepages_block()
1075 cc->nr_migratepages += compound_nr(page); in isolate_migratepages_block()
1084 if (cc->nr_migratepages >= COMPACT_CLUSTER_MAX && in isolate_migratepages_block()
1085 !cc->rescan && !cc->contended) { in isolate_migratepages_block()
1114 putback_movable_pages(&cc->migratepages); in isolate_migratepages_block()
1115 cc->nr_migratepages = 0; in isolate_migratepages_block()
1125 next_skip_pfn += 1UL << cc->order; in isolate_migratepages_block()
1157 if (low_pfn == end_pfn && (!nr_isolated || cc->rescan)) { in isolate_migratepages_block()
1160 update_cached_migrate(cc, low_pfn); in isolate_migratepages_block()
1167 cc->total_migrate_scanned += nr_scanned; in isolate_migratepages_block()
1171 cc->migrate_pfn = low_pfn; in isolate_migratepages_block()
1186 isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn, in isolate_migratepages_range() argument
1195 if (block_start_pfn < cc->zone->zone_start_pfn) in isolate_migratepages_range()
1196 block_start_pfn = cc->zone->zone_start_pfn; in isolate_migratepages_range()
1206 block_end_pfn, cc->zone)) in isolate_migratepages_range()
1209 ret = isolate_migratepages_block(cc, pfn, block_end_pfn, in isolate_migratepages_range()
1215 if (cc->nr_migratepages >= COMPACT_CLUSTER_MAX) in isolate_migratepages_range()
1225 static bool suitable_migration_source(struct compact_control *cc, in suitable_migration_source() argument
1233 if ((cc->mode != MIGRATE_ASYNC) || !cc->direct_compaction) in suitable_migration_source()
1238 if (cc->migratetype == MIGRATE_MOVABLE) in suitable_migration_source()
1241 return block_mt == cc->migratetype; in suitable_migration_source()
1245 static bool suitable_migration_target(struct compact_control *cc, in suitable_migration_target() argument
1259 if (cc->ignore_block_suitable) in suitable_migration_target()
1271 freelist_scan_limit(struct compact_control *cc) in freelist_scan_limit() argument
1275 return (COMPACT_CLUSTER_MAX >> min(shift, cc->fast_search_fail)) + 1; in freelist_scan_limit()
1282 static inline bool compact_scanners_met(struct compact_control *cc) in compact_scanners_met() argument
1284 return (cc->free_pfn >> pageblock_order) in compact_scanners_met()
1285 <= (cc->migrate_pfn >> pageblock_order); in compact_scanners_met()
1322 fast_isolate_around(struct compact_control *cc, unsigned long pfn, unsigned long nr_isolated) in fast_isolate_around() argument
1328 if (cc->nr_freepages >= cc->nr_migratepages) in fast_isolate_around()
1332 if (cc->direct_compaction && cc->mode == MIGRATE_ASYNC) in fast_isolate_around()
1336 start_pfn = max(pageblock_start_pfn(pfn), cc->zone->zone_start_pfn); in fast_isolate_around()
1337 end_pfn = min(pageblock_end_pfn(pfn), zone_end_pfn(cc->zone)); in fast_isolate_around()
1339 page = pageblock_pfn_to_page(start_pfn, end_pfn, cc->zone); in fast_isolate_around()
1345 isolate_freepages_block(cc, &start_pfn, pfn, &cc->freepages, 1, false); in fast_isolate_around()
1346 if (cc->nr_freepages >= cc->nr_migratepages) in fast_isolate_around()
1353 isolate_freepages_block(cc, &start_pfn, end_pfn, &cc->freepages, 1, false); in fast_isolate_around()
1356 if (cc->nr_freepages < cc->nr_migratepages) in fast_isolate_around()
1361 static int next_search_order(struct compact_control *cc, int order) in next_search_order() argument
1365 order = cc->order - 1; in next_search_order()
1368 if (order == cc->search_order) { in next_search_order()
1369 cc->search_order--; in next_search_order()
1370 if (cc->search_order < 0) in next_search_order()
1371 cc->search_order = cc->order - 1; in next_search_order()
1379 fast_isolate_freepages(struct compact_control *cc) in fast_isolate_freepages() argument
1381 unsigned int limit = max(1U, freelist_scan_limit(cc) >> 1); in fast_isolate_freepages()
1391 if (cc->order <= 0) in fast_isolate_freepages()
1392 return cc->free_pfn; in fast_isolate_freepages()
1398 if (cc->free_pfn >= cc->zone->compact_init_free_pfn) { in fast_isolate_freepages()
1407 distance = (cc->free_pfn - cc->migrate_pfn); in fast_isolate_freepages()
1408 low_pfn = pageblock_start_pfn(cc->free_pfn - (distance >> 2)); in fast_isolate_freepages()
1409 min_pfn = pageblock_start_pfn(cc->free_pfn - (distance >> 1)); in fast_isolate_freepages()
1418 cc->search_order = min_t(unsigned int, cc->order - 1, cc->search_order); in fast_isolate_freepages()
1420 for (order = cc->search_order; in fast_isolate_freepages()
1422 order = next_search_order(cc, order)) { in fast_isolate_freepages()
1423 struct free_area *area = &cc->zone->free_area[order]; in fast_isolate_freepages()
1433 spin_lock_irqsave(&cc->zone->lock, flags); in fast_isolate_freepages()
1444 cc->zone->zone_start_pfn); in fast_isolate_freepages()
1447 cc->fast_search_fail = 0; in fast_isolate_freepages()
1448 cc->search_order = order; in fast_isolate_freepages()
1480 cc->nr_freepages += nr_isolated; in fast_isolate_freepages()
1481 list_add_tail(&page->lru, &cc->freepages); in fast_isolate_freepages()
1485 order = cc->search_order + 1; in fast_isolate_freepages()
1490 spin_unlock_irqrestore(&cc->zone->lock, flags); in fast_isolate_freepages()
1501 cc->fast_search_fail++; in fast_isolate_freepages()
1510 cc->free_pfn = highest; in fast_isolate_freepages()
1512 if (cc->direct_compaction && pfn_valid(min_pfn)) { in fast_isolate_freepages()
1515 zone_end_pfn(cc->zone)), in fast_isolate_freepages()
1516 cc->zone); in fast_isolate_freepages()
1517 cc->free_pfn = min_pfn; in fast_isolate_freepages()
1523 if (highest && highest >= cc->zone->compact_cached_free_pfn) { in fast_isolate_freepages()
1525 cc->zone->compact_cached_free_pfn = highest; in fast_isolate_freepages()
1528 cc->total_free_scanned += nr_scanned; in fast_isolate_freepages()
1530 return cc->free_pfn; in fast_isolate_freepages()
1533 fast_isolate_around(cc, low_pfn, nr_isolated); in fast_isolate_freepages()
1541 static void isolate_freepages(struct compact_control *cc) in isolate_freepages() argument
1543 struct zone *zone = cc->zone; in isolate_freepages()
1549 struct list_head *freelist = &cc->freepages; in isolate_freepages()
1553 isolate_start_pfn = fast_isolate_freepages(cc); in isolate_freepages()
1554 if (cc->nr_freepages) in isolate_freepages()
1568 isolate_start_pfn = cc->free_pfn; in isolate_freepages()
1572 low_pfn = pageblock_end_pfn(cc->migrate_pfn); in isolate_freepages()
1573 stride = cc->mode == MIGRATE_ASYNC ? COMPACT_CLUSTER_MAX : 1; in isolate_freepages()
1599 if (!suitable_migration_target(cc, page)) in isolate_freepages()
1603 if (!isolation_suitable(cc, page)) in isolate_freepages()
1607 nr_isolated = isolate_freepages_block(cc, &isolate_start_pfn, in isolate_freepages()
1612 update_pageblock_skip(cc, page, block_start_pfn); in isolate_freepages()
1615 if (cc->nr_freepages >= cc->nr_migratepages) { in isolate_freepages()
1647 cc->free_pfn = isolate_start_pfn; in isolate_freepages()
1661 struct compact_control *cc = (struct compact_control *)data; in compaction_alloc() local
1664 if (list_empty(&cc->freepages)) { in compaction_alloc()
1665 isolate_freepages(cc); in compaction_alloc()
1667 if (list_empty(&cc->freepages)) in compaction_alloc()
1671 freepage = list_entry(cc->freepages.next, struct page, lru); in compaction_alloc()
1673 cc->nr_freepages--; in compaction_alloc()
1685 struct compact_control *cc = (struct compact_control *)data; in compaction_free() local
1687 list_add(&page->lru, &cc->freepages); in compaction_free()
1688 cc->nr_freepages++; in compaction_free()
1709 update_fast_start_pfn(struct compact_control *cc, unsigned long pfn) in update_fast_start_pfn() argument
1711 if (cc->fast_start_pfn == ULONG_MAX) in update_fast_start_pfn()
1714 if (!cc->fast_start_pfn) in update_fast_start_pfn()
1715 cc->fast_start_pfn = pfn; in update_fast_start_pfn()
1717 cc->fast_start_pfn = min(cc->fast_start_pfn, pfn); in update_fast_start_pfn()
1721 reinit_migrate_pfn(struct compact_control *cc) in reinit_migrate_pfn() argument
1723 if (!cc->fast_start_pfn || cc->fast_start_pfn == ULONG_MAX) in reinit_migrate_pfn()
1724 return cc->migrate_pfn; in reinit_migrate_pfn()
1726 cc->migrate_pfn = cc->fast_start_pfn; in reinit_migrate_pfn()
1727 cc->fast_start_pfn = ULONG_MAX; in reinit_migrate_pfn()
1729 return cc->migrate_pfn; in reinit_migrate_pfn()
1737 static unsigned long fast_find_migrateblock(struct compact_control *cc) in fast_find_migrateblock() argument
1739 unsigned int limit = freelist_scan_limit(cc); in fast_find_migrateblock()
1742 unsigned long pfn = cc->migrate_pfn; in fast_find_migrateblock()
1748 if (cc->ignore_skip_hint) in fast_find_migrateblock()
1756 if (pfn != cc->zone->zone_start_pfn && pfn != pageblock_start_pfn(pfn)) in fast_find_migrateblock()
1764 if (cc->order <= PAGE_ALLOC_COSTLY_ORDER) in fast_find_migrateblock()
1773 if (cc->direct_compaction && cc->migratetype != MIGRATE_MOVABLE) in fast_find_migrateblock()
1782 distance = (cc->free_pfn - cc->migrate_pfn) >> 1; in fast_find_migrateblock()
1783 if (cc->migrate_pfn != cc->zone->zone_start_pfn) in fast_find_migrateblock()
1785 high_pfn = pageblock_start_pfn(cc->migrate_pfn + distance); in fast_find_migrateblock()
1787 for (order = cc->order - 1; in fast_find_migrateblock()
1790 struct free_area *area = &cc->zone->free_area[order]; in fast_find_migrateblock()
1798 spin_lock_irqsave(&cc->zone->lock, flags); in fast_find_migrateblock()
1822 update_fast_start_pfn(cc, free_pfn); in fast_find_migrateblock()
1824 cc->fast_search_fail = 0; in fast_find_migrateblock()
1830 spin_unlock_irqrestore(&cc->zone->lock, flags); in fast_find_migrateblock()
1833 cc->total_migrate_scanned += nr_scanned; in fast_find_migrateblock()
1840 cc->fast_search_fail++; in fast_find_migrateblock()
1841 pfn = reinit_migrate_pfn(cc); in fast_find_migrateblock()
1851 static isolate_migrate_t isolate_migratepages(struct compact_control *cc) in isolate_migratepages() argument
1859 (cc->mode != MIGRATE_SYNC ? ISOLATE_ASYNC_MIGRATE : 0); in isolate_migratepages()
1867 low_pfn = fast_find_migrateblock(cc); in isolate_migratepages()
1869 if (block_start_pfn < cc->zone->zone_start_pfn) in isolate_migratepages()
1870 block_start_pfn = cc->zone->zone_start_pfn; in isolate_migratepages()
1877 fast_find_block = low_pfn != cc->migrate_pfn && !cc->fast_search_fail; in isolate_migratepages()
1886 for (; block_end_pfn <= cc->free_pfn; in isolate_migratepages()
1888 cc->migrate_pfn = low_pfn = block_end_pfn, in isolate_migratepages()
1901 block_end_pfn, cc->zone); in isolate_migratepages()
1913 !fast_find_block && !isolation_suitable(cc, page)) in isolate_migratepages()
1924 if (!suitable_migration_source(cc, page)) { in isolate_migratepages()
1925 update_cached_migrate(cc, block_end_pfn); in isolate_migratepages()
1930 if (isolate_migratepages_block(cc, low_pfn, block_end_pfn, in isolate_migratepages()
1942 return cc->nr_migratepages ? ISOLATE_SUCCESS : ISOLATE_NONE; in isolate_migratepages()
2032 static enum compact_result __compact_finished(struct compact_control *cc) in __compact_finished() argument
2035 const int migratetype = cc->migratetype; in __compact_finished()
2039 if (compact_scanners_met(cc)) { in __compact_finished()
2041 reset_cached_positions(cc->zone); in __compact_finished()
2049 if (cc->direct_compaction) in __compact_finished()
2050 cc->zone->compact_blockskip_flush = true; in __compact_finished()
2052 if (cc->whole_zone) in __compact_finished()
2058 if (cc->proactive_compaction) { in __compact_finished()
2062 pgdat = cc->zone->zone_pgdat; in __compact_finished()
2066 score = fragmentation_score_zone(cc->zone); in __compact_finished()
2077 if (is_via_compact_memory(cc->order)) in __compact_finished()
2086 if (!IS_ALIGNED(cc->migrate_pfn, pageblock_nr_pages)) in __compact_finished()
2091 for (order = cc->order; order < MAX_ORDER; order++) { in __compact_finished()
2092 struct free_area *area = &cc->zone->free_area[order]; in __compact_finished()
2124 if (cc->mode == MIGRATE_ASYNC || in __compact_finished()
2125 IS_ALIGNED(cc->migrate_pfn, in __compact_finished()
2136 if (cc->contended || fatal_signal_pending(current)) in __compact_finished()
2142 static enum compact_result compact_finished(struct compact_control *cc) in compact_finished() argument
2146 ret = __compact_finished(cc); in compact_finished()
2147 trace_mm_compaction_finished(cc->zone, cc->order, ret); in compact_finished()
2275 compact_zone(struct compact_control *cc, struct capture_control *capc) in compact_zone() argument
2278 unsigned long start_pfn = cc->zone->zone_start_pfn; in compact_zone()
2279 unsigned long end_pfn = zone_end_pfn(cc->zone); in compact_zone()
2281 const bool sync = cc->mode != MIGRATE_ASYNC; in compact_zone()
2288 cc->total_migrate_scanned = 0; in compact_zone()
2289 cc->total_free_scanned = 0; in compact_zone()
2290 cc->nr_migratepages = 0; in compact_zone()
2291 cc->nr_freepages = 0; in compact_zone()
2292 INIT_LIST_HEAD(&cc->freepages); in compact_zone()
2293 INIT_LIST_HEAD(&cc->migratepages); in compact_zone()
2295 cc->migratetype = gfp_migratetype(cc->gfp_mask); in compact_zone()
2296 ret = compaction_suitable(cc->zone, cc->order, cc->alloc_flags, in compact_zone()
2297 cc->highest_zoneidx); in compact_zone()
2309 if (compaction_restarting(cc->zone, cc->order)) in compact_zone()
2310 __reset_isolation_suitable(cc->zone); in compact_zone()
2318 cc->fast_start_pfn = 0; in compact_zone()
2319 if (cc->whole_zone) { in compact_zone()
2320 cc->migrate_pfn = start_pfn; in compact_zone()
2321 cc->free_pfn = pageblock_start_pfn(end_pfn - 1); in compact_zone()
2323 cc->migrate_pfn = cc->zone->compact_cached_migrate_pfn[sync]; in compact_zone()
2324 cc->free_pfn = cc->zone->compact_cached_free_pfn; in compact_zone()
2325 if (cc->free_pfn < start_pfn || cc->free_pfn >= end_pfn) { in compact_zone()
2326 cc->free_pfn = pageblock_start_pfn(end_pfn - 1); in compact_zone()
2327 cc->zone->compact_cached_free_pfn = cc->free_pfn; in compact_zone()
2329 if (cc->migrate_pfn < start_pfn || cc->migrate_pfn >= end_pfn) { in compact_zone()
2330 cc->migrate_pfn = start_pfn; in compact_zone()
2331 cc->zone->compact_cached_migrate_pfn[0] = cc->migrate_pfn; in compact_zone()
2332 cc->zone->compact_cached_migrate_pfn[1] = cc->migrate_pfn; in compact_zone()
2335 if (cc->migrate_pfn <= cc->zone->compact_init_migrate_pfn) in compact_zone()
2336 cc->whole_zone = true; in compact_zone()
2350 cc->zone->compact_cached_migrate_pfn[0] == cc->zone->compact_cached_migrate_pfn[1]; in compact_zone()
2352 trace_mm_compaction_begin(start_pfn, cc->migrate_pfn, in compact_zone()
2353 cc->free_pfn, end_pfn, sync); in compact_zone()
2358 while ((ret = compact_finished(cc)) == COMPACT_CONTINUE) { in compact_zone()
2360 unsigned long iteration_start_pfn = cc->migrate_pfn; in compact_zone()
2370 cc->rescan = false; in compact_zone()
2373 cc->rescan = true; in compact_zone()
2376 switch (isolate_migratepages(cc)) { in compact_zone()
2379 putback_movable_pages(&cc->migratepages); in compact_zone()
2380 cc->nr_migratepages = 0; in compact_zone()
2384 cc->zone->compact_cached_migrate_pfn[1] = in compact_zone()
2385 cc->zone->compact_cached_migrate_pfn[0]; in compact_zone()
2399 err = migrate_pages(&cc->migratepages, compaction_alloc, in compact_zone()
2400 compaction_free, (unsigned long)cc, cc->mode, in compact_zone()
2403 trace_mm_compaction_migratepages(cc->nr_migratepages, err, in compact_zone()
2404 &cc->migratepages); in compact_zone()
2407 cc->nr_migratepages = 0; in compact_zone()
2409 putback_movable_pages(&cc->migratepages); in compact_zone()
2414 if (err == -ENOMEM && !compact_scanners_met(cc)) { in compact_zone()
2422 if (cc->direct_compaction && in compact_zone()
2423 (cc->mode == MIGRATE_ASYNC)) { in compact_zone()
2424 cc->migrate_pfn = block_end_pfn( in compact_zone()
2425 cc->migrate_pfn - 1, cc->order); in compact_zone()
2439 if (cc->order > 0 && last_migrated_pfn) { in compact_zone()
2441 block_start_pfn(cc->migrate_pfn, cc->order); in compact_zone()
2444 lru_add_drain_cpu_zone(cc->zone); in compact_zone()
2462 if (cc->nr_freepages > 0) { in compact_zone()
2463 unsigned long free_pfn = release_freepages(&cc->freepages); in compact_zone()
2465 cc->nr_freepages = 0; in compact_zone()
2473 if (free_pfn > cc->zone->compact_cached_free_pfn) in compact_zone()
2474 cc->zone->compact_cached_free_pfn = free_pfn; in compact_zone()
2477 count_compact_events(COMPACTMIGRATE_SCANNED, cc->total_migrate_scanned); in compact_zone()
2478 count_compact_events(COMPACTFREE_SCANNED, cc->total_free_scanned); in compact_zone()
2480 trace_mm_compaction_end(start_pfn, cc->migrate_pfn, in compact_zone()
2481 cc->free_pfn, end_pfn, sync, ret); in compact_zone()
2492 struct compact_control cc = { in compact_zone_order() local
2507 .cc = &cc, in compact_zone_order()
2519 ret = compact_zone(&cc, &capc); in compact_zone_order()
2521 VM_BUG_ON(!list_empty(&cc.freepages)); in compact_zone_order()
2522 VM_BUG_ON(!list_empty(&cc.migratepages)); in compact_zone_order()
2637 struct compact_control cc = { in proactive_compact_node() local
2651 cc.zone = zone; in proactive_compact_node()
2653 compact_zone(&cc, NULL); in proactive_compact_node()
2655 VM_BUG_ON(!list_empty(&cc.freepages)); in proactive_compact_node()
2656 VM_BUG_ON(!list_empty(&cc.migratepages)); in proactive_compact_node()
2666 struct compact_control cc = { in compact_node() local
2681 cc.zone = zone; in compact_node()
2683 compact_zone(&cc, NULL); in compact_node()
2685 VM_BUG_ON(!list_empty(&cc.freepages)); in compact_node()
2686 VM_BUG_ON(!list_empty(&cc.migratepages)); in compact_node()
2809 struct compact_control cc = { in kcompactd_do_work() local
2817 trace_mm_compaction_kcompactd_wake(pgdat->node_id, cc.order, in kcompactd_do_work()
2818 cc.highest_zoneidx); in kcompactd_do_work()
2821 for (zoneid = 0; zoneid <= cc.highest_zoneidx; zoneid++) { in kcompactd_do_work()
2828 if (compaction_deferred(zone, cc.order)) in kcompactd_do_work()
2831 if (compaction_suitable(zone, cc.order, 0, zoneid) != in kcompactd_do_work()
2838 cc.zone = zone; in kcompactd_do_work()
2839 status = compact_zone(&cc, NULL); in kcompactd_do_work()
2842 compaction_defer_reset(zone, cc.order, false); in kcompactd_do_work()
2856 defer_compaction(zone, cc.order); in kcompactd_do_work()
2860 cc.total_migrate_scanned); in kcompactd_do_work()
2862 cc.total_free_scanned); in kcompactd_do_work()
2864 VM_BUG_ON(!list_empty(&cc.freepages)); in kcompactd_do_work()
2865 VM_BUG_ON(!list_empty(&cc.migratepages)); in kcompactd_do_work()
2873 if (pgdat->kcompactd_max_order <= cc.order) in kcompactd_do_work()
2875 if (pgdat->kcompactd_highest_zoneidx >= cc.highest_zoneidx) in kcompactd_do_work()