]> git.hungrycats.org Git - linux/commitdiff
mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag()
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Thu, 28 Aug 2014 18:34:22 +0000 (19:34 +0100)
committerJiri Slaby <jslaby@suse.cz>
Fri, 26 Sep 2014 09:51:52 +0000 (11:51 +0200)
commit 52c8f6a5aeb0bdd396849ecaa72d96f8175528f5 upstream.

In general, every tracepoint should be zero overhead if it is disabled.
However, trace_mm_page_alloc_extfrag() is one of exception.  It evaluate
"new_type == start_migratetype" even if tracepoint is disabled.

However, the code can be moved into tracepoint's TP_fast_assign() and
TP_fast_assign exist exactly such purpose.  This patch does it.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
include/trace/events/kmem.h
mm/page_alloc.c

index d0c613476620fa9da3f60220557dee19eb725c86..aece1346ceb741bf11dd0d70215a4f91e9eeba3c 100644 (file)
@@ -267,14 +267,12 @@ DEFINE_EVENT_PRINT(mm_page, mm_page_pcpu_drain,
 TRACE_EVENT(mm_page_alloc_extfrag,
 
        TP_PROTO(struct page *page,
-                       int alloc_order, int fallback_order,
-                       int alloc_migratetype, int fallback_migratetype,
-                       int change_ownership),
+               int alloc_order, int fallback_order,
+               int alloc_migratetype, int fallback_migratetype, int new_migratetype),
 
        TP_ARGS(page,
                alloc_order, fallback_order,
-               alloc_migratetype, fallback_migratetype,
-               change_ownership),
+               alloc_migratetype, fallback_migratetype, new_migratetype),
 
        TP_STRUCT__entry(
                __field(        struct page *,  page                    )
@@ -291,7 +289,7 @@ TRACE_EVENT(mm_page_alloc_extfrag,
                __entry->fallback_order         = fallback_order;
                __entry->alloc_migratetype      = alloc_migratetype;
                __entry->fallback_migratetype   = fallback_migratetype;
-               __entry->change_ownership       = change_ownership;
+               __entry->change_ownership       = (new_migratetype == alloc_migratetype);
        ),
 
        TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d",
index 8b010ca23361f669974d5329b24003c0a9c00f01..e285eaca2ba9f9604ab368f60fd72a4b9c226313 100644 (file)
@@ -1118,9 +1118,8 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
                               is_migrate_cma(migratetype)
                             ? migratetype : start_migratetype);
 
-                       trace_mm_page_alloc_extfrag(page, order,
-                               current_order, start_migratetype, migratetype,
-                               new_type == start_migratetype);
+                       trace_mm_page_alloc_extfrag(page, order, current_order,
+                               start_migratetype, migratetype, new_type);
 
                        return page;
                }