I don't understand this part. @@ -2279,14 +2286,24 @@ static enum compact_result compact_zone_order(struct zone *zone, int order, .ignore_skip_hint = (prio == MIN_COMPACT_PRIORITY), .ignore_block_suitable = (prio == MIN_COMPACT_PRIORITY) }; + struct capture_control capc = { + .cc = &cc, + .page = NULL, + }; + + if (capture) + current->capture_control = &capc; That check will always be true as it is, struct page **capture; *capture could be NULL, but not capture because in __alloc_pages_direct_compact(), it does, struct page *page = NULL; capture = &page;