Skip to content

Commit f46012c

Browse files
hnazakpm00
authored andcommitted
mm: page_alloc: trace type pollution from compaction capturing
When the page allocator places pages of a certain migratetype into blocks of another type, it has lasting effects on the ability to compact and defragment down the line. For improving placement and compaction, visibility into such events is crucial. The most common case, allocator fallbacks, is already annotated, but compaction capturing is also allowed to grab pages of a different type. Extend the tracepoint to cover this case. Link: https://lkml.kernel.org/r/20250313210647.1314586-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Zi Yan <ziy@nvidia.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 67914ac commit f46012c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mm/page_alloc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,10 @@ compaction_capture(struct capture_control *capc, struct page *page,
614614
capc->cc->migratetype != MIGRATE_MOVABLE)
615615
return false;
616616

617+
if (migratetype != capc->cc->migratetype)
618+
trace_mm_page_alloc_extfrag(page, capc->cc->order, order,
619+
capc->cc->migratetype, migratetype);
620+
617621
capc->page = page;
618622
return true;
619623
}

0 commit comments

Comments
 (0)