From 33aae21e9959267e70d6f20d25e76ee13ac0a3dc Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: Wed, 14 May 2014 10:02:10 +1000 Subject: [PATCH] mm-compaction-do-not-count-migratepages-when-unnecessary-fix list_for_each is enough for counting the list length. We also avoid including struct page definition this way. Suggested-by: Michal Nazarewicz Signed-off-by: Vlastimil Babka Signed-off-by: Andrew Morton --- include/trace/events/compaction.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index aacaf0fab48d..c6814b917bdf 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h @@ -7,7 +7,6 @@ #include #include #include -#include #include DECLARE_EVENT_CLASS(mm_compaction_isolate_template, @@ -62,7 +61,7 @@ TRACE_EVENT(mm_compaction_migratepages, TP_fast_assign( unsigned long nr_failed = 0; - struct page *page; + struct list_head *page_lru; /* * migrate_pages() returns either a non-negative number @@ -73,7 +72,7 @@ TRACE_EVENT(mm_compaction_migratepages, if (migrate_rc >= 0) nr_failed = migrate_rc; else - list_for_each_entry(page, migratepages, lru) + list_for_each(page_lru, migratepages) nr_failed++; __entry->nr_migrated = nr_all - nr_failed; -- 2.39.5