diff options
author | Mel Gorman <mgorman@suse.de> | 2014-01-21 18:51:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:48 -0500 |
commit | af1839d722c986ffeaae1e70a6ef1c75ff38dcd5 (patch) | |
tree | 9de959141096c28bbb9ff65ffe8e087f88df231d | |
parent | 1c5e9c27cbd966c7f0038698d5dcd5ada3574f47 (diff) |
mm: numa: trace tasks that fail migration due to rate limiting
A low local/remote numa hinting fault ratio is potentially explained by
failed migrations. This patch adds a tracepoint that fires when
migration fails due to migration rate limitation.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/trace/events/migrate.h | 26 | ||||
-rw-r--r-- | mm/migrate.c | 5 |
2 files changed, 30 insertions, 1 deletions
diff --git a/include/trace/events/migrate.h b/include/trace/events/migrate.h index ec2a6ccfd7e5..3075ffbb9a83 100644 --- a/include/trace/events/migrate.h +++ b/include/trace/events/migrate.h | |||
@@ -45,6 +45,32 @@ TRACE_EVENT(mm_migrate_pages, | |||
45 | __print_symbolic(__entry->reason, MIGRATE_REASON)) | 45 | __print_symbolic(__entry->reason, MIGRATE_REASON)) |
46 | ); | 46 | ); |
47 | 47 | ||
48 | TRACE_EVENT(mm_numa_migrate_ratelimit, | ||
49 | |||
50 | TP_PROTO(struct task_struct *p, int dst_nid, unsigned long nr_pages), | ||
51 | |||
52 | TP_ARGS(p, dst_nid, nr_pages), | ||
53 | |||
54 | TP_STRUCT__entry( | ||
55 | __array( char, comm, TASK_COMM_LEN) | ||
56 | __field( pid_t, pid) | ||
57 | __field( int, dst_nid) | ||
58 | __field( unsigned long, nr_pages) | ||
59 | ), | ||
60 | |||
61 | TP_fast_assign( | ||
62 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
63 | __entry->pid = p->pid; | ||
64 | __entry->dst_nid = dst_nid; | ||
65 | __entry->nr_pages = nr_pages; | ||
66 | ), | ||
67 | |||
68 | TP_printk("comm=%s pid=%d dst_nid=%d nr_pages=%lu", | ||
69 | __entry->comm, | ||
70 | __entry->pid, | ||
71 | __entry->dst_nid, | ||
72 | __entry->nr_pages) | ||
73 | ); | ||
48 | #endif /* _TRACE_MIGRATE_H */ | 74 | #endif /* _TRACE_MIGRATE_H */ |
49 | 75 | ||
50 | /* This part must be outside protection */ | 76 | /* This part must be outside protection */ |
diff --git a/mm/migrate.c b/mm/migrate.c index 4612bb2e3677..f9e16350d09c 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -1614,8 +1614,11 @@ static bool numamigrate_update_ratelimit(pg_data_t *pgdat, | |||
1614 | msecs_to_jiffies(migrate_interval_millisecs); | 1614 | msecs_to_jiffies(migrate_interval_millisecs); |
1615 | spin_unlock(&pgdat->numabalancing_migrate_lock); | 1615 | spin_unlock(&pgdat->numabalancing_migrate_lock); |
1616 | } | 1616 | } |
1617 | if (pgdat->numabalancing_migrate_nr_pages > ratelimit_pages) | 1617 | if (pgdat->numabalancing_migrate_nr_pages > ratelimit_pages) { |
1618 | trace_mm_numa_migrate_ratelimit(current, pgdat->node_id, | ||
1619 | nr_pages); | ||
1618 | return true; | 1620 | return true; |
1621 | } | ||
1619 | 1622 | ||
1620 | /* | 1623 | /* |
1621 | * This is an unlocked non-atomic update so errors are possible. | 1624 | * This is an unlocked non-atomic update so errors are possible. |