diff options
-rw-r--r-- | include/linux/vm_event_item.h | 2 | ||||
-rw-r--r-- | mm/compaction.c | 8 | ||||
-rw-r--r-- | mm/vmstat.c | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 8aa7cb9..a1f750b 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -42,6 +42,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, PGMIGRATE_SUCCESS, PGMIGRATE_FAIL, #endif #ifdef CONFIG_COMPACTION + COMPACTMIGRATE_SCANNED, COMPACTFREE_SCANNED, + COMPACTISOLATED, COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS, #endif #ifdef CONFIG_HUGETLB_PAGE diff --git a/mm/compaction.c b/mm/compaction.c index 2c077a7..aee7443 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -356,6 +356,10 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, if (blockpfn == end_pfn) update_pageblock_skip(cc, valid_page, total_isolated, false); + count_vm_events(COMPACTFREE_SCANNED, nr_scanned); + if (total_isolated) + count_vm_events(COMPACTISOLATED, total_isolated); + return total_isolated; } @@ -646,6 +650,10 @@ next_pageblock: trace_mm_compaction_isolate_migratepages(nr_scanned, nr_isolated); + count_vm_events(COMPACTMIGRATE_SCANNED, nr_scanned); + if (nr_isolated) + count_vm_events(COMPACTISOLATED, nr_isolated); + return low_pfn; } diff --git a/mm/vmstat.c b/mm/vmstat.c index 89a7fd6..3a067fa 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -779,6 +779,9 @@ const char * const vmstat_text[] = { "pgmigrate_fail", #endif #ifdef CONFIG_COMPACTION + "compact_migrate_scanned", + "compact_free_scanned", + "compact_isolated", "compact_stall", "compact_fail", "compact_success", |