Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52c8f6a5 authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by Linus Torvalds
Browse files

mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag()



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: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: default avatarMel Gorman <mgorman@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5d0f3f72
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -268,13 +268,11 @@ TRACE_EVENT(mm_page_alloc_extfrag,


	TP_PROTO(struct page *page,
	TP_PROTO(struct page *page,
		int alloc_order, int fallback_order,
		int alloc_order, int fallback_order,
			int alloc_migratetype, int fallback_migratetype,
		int alloc_migratetype, int fallback_migratetype, int new_migratetype),
			int change_ownership),


	TP_ARGS(page,
	TP_ARGS(page,
		alloc_order, fallback_order,
		alloc_order, fallback_order,
		alloc_migratetype, fallback_migratetype,
		alloc_migratetype, fallback_migratetype, new_migratetype),
		change_ownership),


	TP_STRUCT__entry(
	TP_STRUCT__entry(
		__field(	struct page *,	page			)
		__field(	struct page *,	page			)
@@ -291,7 +289,7 @@ TRACE_EVENT(mm_page_alloc_extfrag,
		__entry->fallback_order		= fallback_order;
		__entry->fallback_order		= fallback_order;
		__entry->alloc_migratetype	= alloc_migratetype;
		__entry->alloc_migratetype	= alloc_migratetype;
		__entry->fallback_migratetype	= fallback_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",
	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",
+2 −3
Original line number Original line Diff line number Diff line
@@ -1103,9 +1103,8 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
			       is_migrate_cma(migratetype)
			       is_migrate_cma(migratetype)
			     ? migratetype : start_migratetype);
			     ? migratetype : start_migratetype);


			trace_mm_page_alloc_extfrag(page, order,
			trace_mm_page_alloc_extfrag(page, order, current_order,
				current_order, start_migratetype, migratetype,
				start_migratetype, migratetype, new_type);
				new_type == start_migratetype);


			return page;
			return page;
		}
		}