diff options
author | Mark Brown <broonie@kernel.org> | 2014-11-22 11:15:34 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-22 12:51:05 +0000 |
commit | 28aa2be47924f6b971a6d323b3b4083228c8214f (patch) | |
tree | 0a8b1ee3d68f262338fb2e9e17badc3557f4f8c4 /include/trace/events/compaction.h | |
parent | a6b8ad1106ba7e875e1ea94657f19eb0636ce0b2 (diff) | |
parent | 1f0f80ecae848b0ca2ca632e94568721494f09f0 (diff) |
Merge branch 'linux-linaro-lsk-v3.14' into linux-linaro-lsk-v3.14-rtlsk-v3.14-rt-14.11
Conflicts:
include/linux/radix-tree.h
kernel/rcu/tree.c
mm/filemap.c
mm/page_alloc.c
Diffstat (limited to 'include/trace/events/compaction.h')
-rw-r--r-- | include/trace/events/compaction.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index 06f544ef2f6f..c6814b917bdf 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h @@ -5,6 +5,7 @@ #define _TRACE_COMPACTION_H #include <linux/types.h> +#include <linux/list.h> #include <linux/tracepoint.h> #include <trace/events/gfpflags.h> @@ -47,10 +48,11 @@ DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages, TRACE_EVENT(mm_compaction_migratepages, - TP_PROTO(unsigned long nr_migrated, - unsigned long nr_failed), + TP_PROTO(unsigned long nr_all, + int migrate_rc, + struct list_head *migratepages), - TP_ARGS(nr_migrated, nr_failed), + TP_ARGS(nr_all, migrate_rc, migratepages), TP_STRUCT__entry( __field(unsigned long, nr_migrated) @@ -58,7 +60,22 @@ TRACE_EVENT(mm_compaction_migratepages, ), TP_fast_assign( - __entry->nr_migrated = nr_migrated; + unsigned long nr_failed = 0; + struct list_head *page_lru; + + /* + * migrate_pages() returns either a non-negative number + * with the number of pages that failed migration, or an + * error code, in which case we need to count the remaining + * pages manually + */ + if (migrate_rc >= 0) + nr_failed = migrate_rc; + else + list_for_each(page_lru, migratepages) + nr_failed++; + + __entry->nr_migrated = nr_all - nr_failed; __entry->nr_failed = nr_failed; ), |