compaction.c (1da2f328fa643bd72197dfed0c655148af31e4eb) compaction.c (6467552ca64c4ddd2b83ed73192107d7145f533b)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/mm/compaction.c
4 *
5 * Memory compaction for the reduction of external fragmentation. Note that
6 * this heavily depends upon page migration to do all the real heavy
7 * lifting
8 *

--- 2300 unchanged lines hidden (view full) ---

2309 .ignore_skip_hint = (prio == MIN_COMPACT_PRIORITY),
2310 .ignore_block_suitable = (prio == MIN_COMPACT_PRIORITY)
2311 };
2312 struct capture_control capc = {
2313 .cc = &cc,
2314 .page = NULL,
2315 };
2316
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/mm/compaction.c
4 *
5 * Memory compaction for the reduction of external fragmentation. Note that
6 * this heavily depends upon page migration to do all the real heavy
7 * lifting
8 *

--- 2300 unchanged lines hidden (view full) ---

2309 .ignore_skip_hint = (prio == MIN_COMPACT_PRIORITY),
2310 .ignore_block_suitable = (prio == MIN_COMPACT_PRIORITY)
2311 };
2312 struct capture_control capc = {
2313 .cc = &cc,
2314 .page = NULL,
2315 };
2316
2317 if (capture)
2318 current->capture_control = &capc;
2317 current->capture_control = &capc;
2319
2320 ret = compact_zone(&cc, &capc);
2321
2322 VM_BUG_ON(!list_empty(&cc.freepages));
2323 VM_BUG_ON(!list_empty(&cc.migratepages));
2324
2325 *capture = capc.page;
2326 current->capture_control = NULL;

--- 5 unchanged lines hidden (view full) ---

2332
2333/**
2334 * try_to_compact_pages - Direct compact to satisfy a high-order allocation
2335 * @gfp_mask: The GFP mask of the current allocation
2336 * @order: The order of the current allocation
2337 * @alloc_flags: The allocation flags of the current allocation
2338 * @ac: The context of current allocation
2339 * @prio: Determines how hard direct compaction should try to succeed
2318
2319 ret = compact_zone(&cc, &capc);
2320
2321 VM_BUG_ON(!list_empty(&cc.freepages));
2322 VM_BUG_ON(!list_empty(&cc.migratepages));
2323
2324 *capture = capc.page;
2325 current->capture_control = NULL;

--- 5 unchanged lines hidden (view full) ---

2331
2332/**
2333 * try_to_compact_pages - Direct compact to satisfy a high-order allocation
2334 * @gfp_mask: The GFP mask of the current allocation
2335 * @order: The order of the current allocation
2336 * @alloc_flags: The allocation flags of the current allocation
2337 * @ac: The context of current allocation
2338 * @prio: Determines how hard direct compaction should try to succeed
2339 * @capture: Pointer to free page created by compaction will be stored here
2340 *
2341 * This is the main entry point for direct page compaction.
2342 */
2343enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
2344 unsigned int alloc_flags, const struct alloc_context *ac,
2345 enum compact_priority prio, struct page **capture)
2346{
2347 int may_perform_io = gfp_mask & __GFP_IO;

--- 392 unchanged lines hidden ---
2340 *
2341 * This is the main entry point for direct page compaction.
2342 */
2343enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
2344 unsigned int alloc_flags, const struct alloc_context *ac,
2345 enum compact_priority prio, struct page **capture)
2346{
2347 int may_perform_io = gfp_mask & __GFP_IO;

--- 392 unchanged lines hidden ---