mm: add compaction success and failure tracepoints
Add extra compaction tracepoints to allow extended memory fragmentation
introspection:
- mm_compaction_success and
- mm_compaction_failure
This allows for better introspection of what exactly is happening at
either failure or success of memory compaction, as we try to evaluate
memory fragmentation in extreme situations.
Changes include:
- Add two extra new tracepoints:
* mm_compaction_success
* mm_compaction_failure
- Add COMPACTSUCCESS_EXTFRAG vmstat counter to track successful
compactions that still result in fragmented memory (fragmentation
index > 0 and <= 1000)
- Export fill_contig_page_info() and __fragmentation_index() from
vmstat.c to allow fragmentation calculation in page allocation path
capture detailed compaction outcomes with zone, order, and
fragmentation data
- Calculate fragmentation index after successful compaction to determine
if memory remains fragmented despite successful allocation
The fragmentation index calculation helps identify cases where
compaction succeeds but still leaves the zone fragmented. A positive
index (0-1000) indicates some level of fragmentation exists, with
higher values meaning more fragmentation. This data is crucial for
understanding:
- How bad are situations, really?
- At what order did a compaction fail?
- Compaction efficiency in reducing fragmentation
- Whether successful allocations are masking underlying fragmentation
issues
- The relationship between allocation success and zone health
The new tracepoints provide runtime visibility into:
- Which zones and orders are experiencing compaction events
- The resulting fragmentation state after successful compaction
- Failure patterns for specific allocation orders
This instrumentation will help us build visualizations of compaction
over time.
Signed-off-by: Swarna Prabhu <s.prabhu@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
5 files changed