diff options
author | Mel Gorman <mgorman@suse.de> | 2012-10-19 10:46:20 +0100 |
---|---|---|
committer | Mel Gorman <mgorman@suse.de> | 2012-12-11 14:28:35 +0000 |
commit | 5647bc293ab15f66a7b1cda850c5e9d162a6c7c2 (patch) | |
tree | ebf21726915b1e814046c950c5882e33dad303b9 /mm/migrate.c | |
parent | 1233d588210737ed3696b44c26e71dfa44a6995a (diff) | |
download | linux-5647bc293ab15f66a7b1cda850c5e9d162a6c7c2.tar.gz linux-5647bc293ab15f66a7b1cda850c5e9d162a6c7c2.tar.bz2 linux-5647bc293ab15f66a7b1cda850c5e9d162a6c7c2.zip |
mm: compaction: Move migration fail/success stats to migrate.c
The compact_pages_moved and compact_pagemigrate_failed events are
convenient for determining if compaction is active and to what
degree migration is succeeding but it's at the wrong level. Other
users of migration may also want to know if migration is working
properly and this will be particularly true for any automated
NUMA migration. This patch moves the counters down to migration
with the new events called pgmigrate_success and pgmigrate_fail.
The compact_blocks_moved counter is removed because while it was
useful for debugging initially, it's worthless now as no meaningful
conclusions can be drawn from its value.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 77ed2d773705..04687f69cc17 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -962,6 +962,7 @@ int migrate_pages(struct list_head *from, { int retry = 1; int nr_failed = 0; + int nr_succeeded = 0; int pass = 0; struct page *page; struct page *page2; @@ -988,6 +989,7 @@ int migrate_pages(struct list_head *from, retry++; break; case 0: + nr_succeeded++; break; default: /* Permanent failure */ @@ -998,6 +1000,10 @@ int migrate_pages(struct list_head *from, } rc = 0; out: + if (nr_succeeded) + count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded); + if (nr_failed) + count_vm_events(PGMIGRATE_FAIL, nr_failed); if (!swapwrite) current->flags &= ~PF_SWAPWRITE; |