]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm-compaction-do-not-count-migratepages-when-unnecessary-fix
authorVlastimil Babka <vbabka@suse.cz>
Thu, 22 May 2014 00:43:14 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:14 +0000 (10:43 +1000)
list_for_each is enough for counting the list length.  We also avoid
including struct page definition this way.

Suggested-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/trace/events/compaction.h

index aacaf0fab48d29dfa6a63b5dd797bbb8140cdb3f..c6814b917bdfb17bfaf6a8f096787b49913343a2 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/tracepoint.h>
-#include <linux/mm_types.h>
 #include <trace/events/gfpflags.h>
 
 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;