diff options
author | Mel Gorman <mgorman@suse.de> | 2012-10-19 05:46:20 -0400 |
---|---|---|
committer | Mel Gorman <mgorman@suse.de> | 2012-12-11 09:28:35 -0500 |
commit | 5647bc293ab15f66a7b1cda850c5e9d162a6c7c2 (patch) | |
tree | ebf21726915b1e814046c950c5882e33dad303b9 /mm | |
parent | 1233d588210737ed3696b44c26e71dfa44a6995a (diff) |
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')
-rw-r--r-- | mm/compaction.c | 4 | ||||
-rw-r--r-- | mm/migrate.c | 6 | ||||
-rw-r--r-- | mm/vmstat.c | 7 |
3 files changed, 10 insertions, 7 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 9eef55838fca..00ad88395216 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -994,10 +994,6 @@ static int compact_zone(struct zone *zone, struct compact_control *cc) | |||
994 | update_nr_listpages(cc); | 994 | update_nr_listpages(cc); |
995 | nr_remaining = cc->nr_migratepages; | 995 | nr_remaining = cc->nr_migratepages; |
996 | 996 | ||
997 | count_vm_event(COMPACTBLOCKS); | ||
998 | count_vm_events(COMPACTPAGES, nr_migrate - nr_remaining); | ||
999 | if (nr_remaining) | ||
1000 | count_vm_events(COMPACTPAGEFAILED, nr_remaining); | ||
1001 | trace_mm_compaction_migratepages(nr_migrate - nr_remaining, | 997 | trace_mm_compaction_migratepages(nr_migrate - nr_remaining, |
1002 | nr_remaining); | 998 | nr_remaining); |
1003 | 999 | ||
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, | |||
962 | { | 962 | { |
963 | int retry = 1; | 963 | int retry = 1; |
964 | int nr_failed = 0; | 964 | int nr_failed = 0; |
965 | int nr_succeeded = 0; | ||
965 | int pass = 0; | 966 | int pass = 0; |
966 | struct page *page; | 967 | struct page *page; |
967 | struct page *page2; | 968 | struct page *page2; |
@@ -988,6 +989,7 @@ int migrate_pages(struct list_head *from, | |||
988 | retry++; | 989 | retry++; |
989 | break; | 990 | break; |
990 | case 0: | 991 | case 0: |
992 | nr_succeeded++; | ||
991 | break; | 993 | break; |
992 | default: | 994 | default: |
993 | /* Permanent failure */ | 995 | /* Permanent failure */ |
@@ -998,6 +1000,10 @@ int migrate_pages(struct list_head *from, | |||
998 | } | 1000 | } |
999 | rc = 0; | 1001 | rc = 0; |
1000 | out: | 1002 | out: |
1003 | if (nr_succeeded) | ||
1004 | count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded); | ||
1005 | if (nr_failed) | ||
1006 | count_vm_events(PGMIGRATE_FAIL, nr_failed); | ||
1001 | if (!swapwrite) | 1007 | if (!swapwrite) |
1002 | current->flags &= ~PF_SWAPWRITE; | 1008 | current->flags &= ~PF_SWAPWRITE; |
1003 | 1009 | ||
diff --git a/mm/vmstat.c b/mm/vmstat.c index c7370579111b..89a7fd665b32 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -774,10 +774,11 @@ const char * const vmstat_text[] = { | |||
774 | 774 | ||
775 | "pgrotated", | 775 | "pgrotated", |
776 | 776 | ||
777 | #ifdef CONFIG_MIGRATION | ||
778 | "pgmigrate_success", | ||
779 | "pgmigrate_fail", | ||
780 | #endif | ||
777 | #ifdef CONFIG_COMPACTION | 781 | #ifdef CONFIG_COMPACTION |
778 | "compact_blocks_moved", | ||
779 | "compact_pages_moved", | ||
780 | "compact_pagemigrate_failed", | ||
781 | "compact_stall", | 782 | "compact_stall", |
782 | "compact_fail", | 783 | "compact_fail", |
783 | "compact_success", | 784 | "compact_success", |