Lines Matching refs: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
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()
159 static void defer_compaction(struct zone *zone, int order) in defer_compaction() argument
164 if (order < zone->compact_order_failed) in defer_compaction()
165 zone->compact_order_failed = order; in defer_compaction()
170 trace_mm_compaction_defer_compaction(zone, order); in defer_compaction()
174 static bool compaction_deferred(struct zone *zone, int order) in compaction_deferred() argument
178 if (order < zone->compact_order_failed) in compaction_deferred()
187 trace_mm_compaction_deferred(zone, order); in compaction_deferred()
197 void compaction_defer_reset(struct zone *zone, int order, in compaction_defer_reset() argument
204 if (order >= zone->compact_order_failed) in compaction_defer_reset()
205 zone->compact_order_failed = order + 1; in compaction_defer_reset()
207 trace_mm_compaction_defer_reset(zone, order); in compaction_defer_reset()
211 static bool compaction_restarting(struct zone *zone, int order) in compaction_restarting() argument
213 if (order < zone->compact_order_failed) in compaction_restarting()
562 unsigned int order; in isolate_freepages_block() local
594 const unsigned int order = compound_order(page); in isolate_freepages_block() local
596 if (likely(order < MAX_ORDER)) { in isolate_freepages_block()
597 blockpfn += (1UL << order) - 1; in isolate_freepages_block()
598 cursor += (1UL << order) - 1; in isolate_freepages_block()
623 order = buddy_order(page); in isolate_freepages_block()
624 isolated = __isolate_free_page(page, order); in isolate_freepages_block()
627 set_page_private(page, order); in isolate_freepages_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()
969 const unsigned int order = compound_order(page); in isolate_migratepages_block() local
971 if (likely(order < MAX_ORDER)) in isolate_migratepages_block()
972 low_pfn += (1UL << order) - 1; in isolate_migratepages_block()
1125 next_skip_pfn += 1UL << cc->order; in isolate_migratepages_block()
1361 static int next_search_order(struct compact_control *cc, int order) in next_search_order() argument
1363 order--; in next_search_order()
1364 if (order < 0) in next_search_order()
1365 order = cc->order - 1; in next_search_order()
1368 if (order == cc->search_order) { in next_search_order()
1371 cc->search_order = cc->order - 1; in next_search_order()
1375 return order; in next_search_order()
1388 int order; in fast_isolate_freepages() local
1391 if (cc->order <= 0) 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()
1421 !page && order >= 0; 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()
1448 cc->search_order = order; in fast_isolate_freepages()
1477 if (__isolate_free_page(page, order)) { in fast_isolate_freepages()
1478 set_page_private(page, order); in fast_isolate_freepages()
1479 nr_isolated = 1 << order; in fast_isolate_freepages()
1485 order = cc->search_order + 1; in fast_isolate_freepages()
1744 int order; in fast_find_migrateblock() local
1764 if (cc->order <= PAGE_ALLOC_COSTLY_ORDER) in fast_find_migrateblock()
1787 for (order = cc->order - 1; in fast_find_migrateblock()
1788 order >= PAGE_ALLOC_COSTLY_ORDER && !found_block && nr_scanned < limit; in fast_find_migrateblock()
1789 order--) { in fast_find_migrateblock()
1790 struct free_area *area = &cc->zone->free_area[order]; in fast_find_migrateblock()
1949 static inline bool is_via_compact_memory(int order) in is_via_compact_memory() argument
1951 return order == -1; in is_via_compact_memory()
2034 unsigned int order; in __compact_finished() local
2077 if (is_via_compact_memory(cc->order)) 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()
2109 if (find_suitable_fallback(area, order, migratetype, in __compact_finished()
2147 trace_mm_compaction_finished(cc->zone, cc->order, ret); in compact_finished()
2154 static enum compact_result __compaction_suitable(struct zone *zone, int order, in __compaction_suitable() argument
2161 if (is_via_compact_memory(order)) in __compaction_suitable()
2169 if (zone_watermark_ok(zone, order, watermark, highest_zoneidx, in __compaction_suitable()
2187 watermark = (order > PAGE_ALLOC_COSTLY_ORDER) ? in __compaction_suitable()
2189 watermark += compact_gap(order); in __compaction_suitable()
2204 enum compact_result compaction_suitable(struct zone *zone, int order, in compaction_suitable() argument
2211 ret = __compaction_suitable(zone, order, alloc_flags, highest_zoneidx, in compaction_suitable()
2229 if (ret == COMPACT_CONTINUE && (order > PAGE_ALLOC_COSTLY_ORDER)) { in compaction_suitable()
2230 fragindex = fragmentation_index(zone, order); in compaction_suitable()
2235 trace_mm_compaction_suitable(zone, order, ret); in compaction_suitable()
2242 bool compaction_zonelist_suitable(struct alloc_context *ac, int order, in compaction_zonelist_suitable() argument
2263 available = zone_reclaimable_pages(zone) / order; in compaction_zonelist_suitable()
2265 compact_result = __compaction_suitable(zone, order, alloc_flags, in compaction_zonelist_suitable()
2296 ret = compaction_suitable(cc->zone, cc->order, cc->alloc_flags, in compact_zone()
2309 if (compaction_restarting(cc->zone, cc->order)) 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()
2486 static enum compact_result compact_zone_order(struct zone *zone, int order, in compact_zone_order() argument
2493 .order = order, in compact_zone_order()
2494 .search_order = order, in compact_zone_order()
2556 enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order, in try_to_compact_pages() argument
2572 trace_mm_compaction_try_to_compact_pages(order, gfp_mask, prio); in try_to_compact_pages()
2580 && compaction_deferred(zone, order)) { in try_to_compact_pages()
2585 status = compact_zone_order(zone, order, gfp_mask, prio, in try_to_compact_pages()
2597 compaction_defer_reset(zone, order, false); in try_to_compact_pages()
2609 defer_compaction(zone, order); in try_to_compact_pages()
2638 .order = -1, in proactive_compact_node()
2667 .order = -1, in compact_node()
2810 .order = pgdat->kcompactd_max_order, in kcompactd_do_work()
2817 trace_mm_compaction_kcompactd_wake(pgdat->node_id, cc.order, 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()
2842 compaction_defer_reset(zone, cc.order, false); in kcompactd_do_work()
2856 defer_compaction(zone, cc.order); in kcompactd_do_work()
2873 if (pgdat->kcompactd_max_order <= cc.order) in kcompactd_do_work()
2879 void wakeup_kcompactd(pg_data_t *pgdat, int order, int highest_zoneidx) in wakeup_kcompactd() argument
2881 if (!order) in wakeup_kcompactd()
2884 if (pgdat->kcompactd_max_order < order) in wakeup_kcompactd()
2885 pgdat->kcompactd_max_order = order; in wakeup_kcompactd()
2900 trace_mm_compaction_wakeup_kcompactd(pgdat->node_id, order, in wakeup_kcompactd()