Lines Matching full:order

48 #define block_start_pfn(pfn, order)	round_down(pfn, 1UL << (order))  argument
49 #define block_end_pfn(pfn, order) ALIGN((pfn) + 1, 1UL << (order)) argument
59 * Page order with-respect-to which proactive compaction
89 unsigned int i, order, nr_pages; in split_map_pages() local
96 order = page_private(page); in split_map_pages()
97 nr_pages = 1 << order; in split_map_pages()
99 post_alloc_hook(page, order, __GFP_MOVABLE); in split_map_pages()
100 if (order) in split_map_pages()
101 split_page(page, order); in split_map_pages()
160 void defer_compaction(struct zone *zone, int order) in defer_compaction() argument
165 if (order < zone->compact_order_failed) in defer_compaction()
166 zone->compact_order_failed = order; in defer_compaction()
171 trace_mm_compaction_defer_compaction(zone, order); in defer_compaction()
175 bool compaction_deferred(struct zone *zone, int order) in compaction_deferred() argument
179 if (order < zone->compact_order_failed) in compaction_deferred()
188 trace_mm_compaction_deferred(zone, order); in compaction_deferred()
194 * Update defer tracking counters after successful compaction of given order,
198 void compaction_defer_reset(struct zone *zone, int order, in compaction_defer_reset() argument
205 if (order >= zone->compact_order_failed) in compaction_defer_reset()
206 zone->compact_order_failed = order + 1; in compaction_defer_reset()
208 trace_mm_compaction_defer_reset(zone, order); in compaction_defer_reset()
212 bool compaction_restarting(struct zone *zone, int order) in compaction_restarting() argument
214 if (order < zone->compact_order_failed) in compaction_restarting()
241 * released. It is always pointless to compact pages of such order (if they are
565 unsigned int order; in isolate_freepages_block() local
599 const unsigned int order = compound_order(page); in isolate_freepages_block() local
601 if (likely(order < MAX_ORDER)) { in isolate_freepages_block()
602 blockpfn += (1UL << order) - 1; in isolate_freepages_block()
603 cursor += (1UL << order) - 1; in isolate_freepages_block()
627 /* Found a free page, will break it into order-0 pages */ in isolate_freepages_block()
628 order = buddy_order(page); in isolate_freepages_block()
629 isolated = __isolate_free_page(page, order); in isolate_freepages_block()
632 set_page_private(page, order); in isolate_freepages_block()
722 * is more than pageblock order. In this case, we adjust in isolate_freepages_range()
748 * pageblock_nr_pages for some non-negative n. (Max order in isolate_freepages_range()
838 next_skip_pfn = block_end_pfn(low_pfn, cc->order); in isolate_migratepages_block()
847 * previous order-aligned block, and did not skip it due in isolate_migratepages_block()
855 * We failed to isolate in the previous order-aligned in isolate_migratepages_block()
858 * next_skip_pfn by 1 << order, as low_pfn might have in isolate_migratepages_block()
860 * a compound or a high-order buddy page in the in isolate_migratepages_block()
863 next_skip_pfn = block_end_pfn(low_pfn, cc->order); in isolate_migratepages_block()
899 * Skip if free. We read page order here without zone lock in isolate_migratepages_block()
909 * a valid page order. Consider only values in the in isolate_migratepages_block()
910 * valid order range to prevent low_pfn overflow. in isolate_migratepages_block()
926 const unsigned int order = compound_order(page); in isolate_migratepages_block() local
928 if (likely(order < MAX_ORDER)) in isolate_migratepages_block()
929 low_pfn += (1UL << order) - 1; in isolate_migratepages_block()
992 * and it's on LRU. It can only be a THP so the order in isolate_migratepages_block()
1041 * instead of migrating, as we cannot form the cc->order buddy in isolate_migratepages_block()
1060 next_skip_pfn += 1UL << cc->order; in isolate_migratepages_block()
1177 * pageblock, so it's not worth to check order for valid range. in suitable_migration_target()
1283 static int next_search_order(struct compact_control *cc, int order) in next_search_order() argument
1285 order--; in next_search_order()
1286 if (order < 0) in next_search_order()
1287 order = cc->order - 1; in next_search_order()
1290 if (order == cc->search_order) { in next_search_order()
1293 cc->search_order = cc->order - 1; in next_search_order()
1297 return order; in next_search_order()
1310 int order; in fast_isolate_freepages() local
1312 /* Full compaction passes in a negative order */ in fast_isolate_freepages()
1313 if (cc->order <= 0) in fast_isolate_freepages()
1337 * Search starts from the last successful isolation order or the next in fast_isolate_freepages()
1338 * order to search after a previous failure in fast_isolate_freepages()
1340 cc->search_order = min_t(unsigned int, cc->order - 1, cc->search_order); in fast_isolate_freepages()
1342 for (order = cc->search_order; in fast_isolate_freepages()
1343 !page && order >= 0; in fast_isolate_freepages()
1344 order = next_search_order(cc, order)) { in fast_isolate_freepages()
1345 struct free_area *area = &cc->zone->free_area[order]; in fast_isolate_freepages()
1368 cc->search_order = order; in fast_isolate_freepages()
1397 if (__isolate_free_page(page, order)) { in fast_isolate_freepages()
1398 set_page_private(page, order); in fast_isolate_freepages()
1399 nr_isolated = 1 << order; in fast_isolate_freepages()
1405 order = cc->search_order + 1; in fast_isolate_freepages()
1413 * Smaller scan on next order so the total scan ig related in fast_isolate_freepages()
1663 int order; in fast_find_migrateblock() local
1682 if (cc->order <= PAGE_ALLOC_COSTLY_ORDER) in fast_find_migrateblock()
1705 for (order = cc->order - 1; in fast_find_migrateblock()
1706 order >= PAGE_ALLOC_COSTLY_ORDER && pfn == cc->migrate_pfn && nr_scanned < limit; in fast_find_migrateblock()
1707 order--) { in fast_find_migrateblock()
1708 struct free_area *area = &cc->zone->free_area[order]; in fast_find_migrateblock()
1873 * order == -1 is expected when compacting via
1876 static inline bool is_via_compact_memory(int order) in is_via_compact_memory() argument
1878 return order == -1; in is_via_compact_memory()
1953 unsigned int order; in __compact_finished() local
1996 if (is_via_compact_memory(cc->order)) in __compact_finished()
2010 for (order = cc->order; order < MAX_ORDER; order++) { in __compact_finished()
2011 struct free_area *area = &cc->zone->free_area[order]; in __compact_finished()
2028 if (find_suitable_fallback(area, order, migratetype, in __compact_finished()
2066 trace_mm_compaction_finished(cc->zone, cc->order, ret); in compact_finished()
2080 static enum compact_result __compaction_suitable(struct zone *zone, int order, in __compaction_suitable() argument
2087 if (is_via_compact_memory(order)) in __compaction_suitable()
2092 * If watermarks for high-order allocation are already met, there in __compaction_suitable()
2095 if (zone_watermark_ok(zone, order, watermark, highest_zoneidx, in __compaction_suitable()
2100 * Watermarks for order-0 must be met for compaction to be able to in __compaction_suitable()
2113 watermark = (order > PAGE_ALLOC_COSTLY_ORDER) ? in __compaction_suitable()
2115 watermark += compact_gap(order); in __compaction_suitable()
2123 enum compact_result compaction_suitable(struct zone *zone, int order, in compaction_suitable() argument
2130 ret = __compaction_suitable(zone, order, alloc_flags, highest_zoneidx, in compaction_suitable()
2137 * watermarks, but we already failed the high-order watermark check in compaction_suitable()
2148 if (ret == COMPACT_CONTINUE && (order > PAGE_ALLOC_COSTLY_ORDER)) { in compaction_suitable()
2149 fragindex = fragmentation_index(zone, order); in compaction_suitable()
2154 trace_mm_compaction_suitable(zone, order, ret); in compaction_suitable()
2161 bool compaction_zonelist_suitable(struct alloc_context *ac, int order, in compaction_zonelist_suitable() argument
2178 * want to trash just for a single high order allocation which in compaction_zonelist_suitable()
2182 available = zone_reclaimable_pages(zone) / order; in compaction_zonelist_suitable()
2184 compact_result = __compaction_suitable(zone, order, alloc_flags, in compaction_zonelist_suitable()
2215 ret = compaction_suitable(cc->zone, cc->order, cc->alloc_flags, in compact_zone()
2228 if (compaction_restarting(cc->zone, cc->order)) in compact_zone()
2309 * previous cc->order aligned block. in compact_zone()
2339 * order-aligned block, so skip the rest of it. in compact_zone()
2344 cc->migrate_pfn - 1, cc->order); in compact_zone()
2353 * cc->order aligned block where we migrated from? If yes, in compact_zone()
2358 if (cc->order > 0 && last_migrated_pfn) { in compact_zone()
2360 block_start_pfn(cc->migrate_pfn, cc->order); in compact_zone()
2405 static enum compact_result compact_zone_order(struct zone *zone, int order, in compact_zone_order() argument
2412 .order = order, in compact_zone_order()
2413 .search_order = order, in compact_zone_order()
2457 * try_to_compact_pages - Direct compact to satisfy a high-order allocation
2459 * @order: The order of the current allocation
2467 enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order, in try_to_compact_pages() argument
2483 trace_mm_compaction_try_to_compact_pages(order, gfp_mask, prio); in try_to_compact_pages()
2491 && compaction_deferred(zone, order)) { in try_to_compact_pages()
2496 status = compact_zone_order(zone, order, gfp_mask, prio, in try_to_compact_pages()
2508 compaction_defer_reset(zone, order, false); in try_to_compact_pages()
2520 defer_compaction(zone, order); in try_to_compact_pages()
2549 .order = -1, in proactive_compact_node()
2578 .order = -1, in compact_node()
2694 * order is allocatable. in kcompactd_do_work()
2699 .order = pgdat->kcompactd_max_order, in kcompactd_do_work()
2706 trace_mm_compaction_kcompactd_wake(pgdat->node_id, cc.order, in kcompactd_do_work()
2717 if (compaction_deferred(zone, cc.order)) in kcompactd_do_work()
2720 if (compaction_suitable(zone, cc.order, 0, zoneid) != in kcompactd_do_work()
2731 compaction_defer_reset(zone, cc.order, false); in kcompactd_do_work()
2736 * order >= cc.order. This is ratelimited by the in kcompactd_do_work()
2745 defer_compaction(zone, cc.order); in kcompactd_do_work()
2759 * the requested order/highest_zoneidx in case it was higher/tighter in kcompactd_do_work()
2762 if (pgdat->kcompactd_max_order <= cc.order) in kcompactd_do_work()
2768 void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx) in wakeup_kcompactd() argument
2770 if (!order) in wakeup_kcompactd()
2773 if (pgdat->kcompactd_max_order < order) in wakeup_kcompactd()
2774 pgdat->kcompactd_max_order = order; in wakeup_kcompactd()
2789 trace_mm_compaction_wakeup_kcompactd(pgdat->node_id, order, in wakeup_kcompactd()