diff options
author | Mel Gorman <mgorman@suse.de> | 2012-10-19 09:07:31 -0400 |
---|---|---|
committer | Mel Gorman <mgorman@suse.de> | 2012-12-11 09:28:35 -0500 |
commit | 7b2a2d4a18fffac3c4872021529b0657896db788 (patch) | |
tree | a0f05be191f12711a774368f6feb15bcd2eebf1a /mm/migrate.c | |
parent | 5647bc293ab15f66a7b1cda850c5e9d162a6c7c2 (diff) |
mm: migrate: Add a tracepoint for migrate_pages
The pgmigrate_success and pgmigrate_fail vmstat counters tells the user
about migration activity but not the type or the reason. This patch adds
a tracepoint to identify the type of page migration and why the page is
being migrated.
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 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 04687f69cc17..27be9c923dc1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -38,6 +38,9 @@ | |||
38 | 38 | ||
39 | #include <asm/tlbflush.h> | 39 | #include <asm/tlbflush.h> |
40 | 40 | ||
41 | #define CREATE_TRACE_POINTS | ||
42 | #include <trace/events/migrate.h> | ||
43 | |||
41 | #include "internal.h" | 44 | #include "internal.h" |
42 | 45 | ||
43 | /* | 46 | /* |
@@ -958,7 +961,7 @@ out: | |||
958 | */ | 961 | */ |
959 | int migrate_pages(struct list_head *from, | 962 | int migrate_pages(struct list_head *from, |
960 | new_page_t get_new_page, unsigned long private, bool offlining, | 963 | new_page_t get_new_page, unsigned long private, bool offlining, |
961 | enum migrate_mode mode) | 964 | enum migrate_mode mode, int reason) |
962 | { | 965 | { |
963 | int retry = 1; | 966 | int retry = 1; |
964 | int nr_failed = 0; | 967 | int nr_failed = 0; |
@@ -1004,6 +1007,8 @@ out: | |||
1004 | count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded); | 1007 | count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded); |
1005 | if (nr_failed) | 1008 | if (nr_failed) |
1006 | count_vm_events(PGMIGRATE_FAIL, nr_failed); | 1009 | count_vm_events(PGMIGRATE_FAIL, nr_failed); |
1010 | trace_mm_migrate_pages(nr_succeeded, nr_failed, mode, reason); | ||
1011 | |||
1007 | if (!swapwrite) | 1012 | if (!swapwrite) |
1008 | current->flags &= ~PF_SWAPWRITE; | 1013 | current->flags &= ~PF_SWAPWRITE; |
1009 | 1014 | ||
@@ -1145,7 +1150,8 @@ set_status: | |||
1145 | err = 0; | 1150 | err = 0; |
1146 | if (!list_empty(&pagelist)) { | 1151 | if (!list_empty(&pagelist)) { |
1147 | err = migrate_pages(&pagelist, new_page_node, | 1152 | err = migrate_pages(&pagelist, new_page_node, |
1148 | (unsigned long)pm, 0, MIGRATE_SYNC); | 1153 | (unsigned long)pm, 0, MIGRATE_SYNC, |
1154 | MR_SYSCALL); | ||
1149 | if (err) | 1155 | if (err) |
1150 | putback_lru_pages(&pagelist); | 1156 | putback_lru_pages(&pagelist); |
1151 | } | 1157 | } |