* [PATCH] mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag()
@ 2013-10-25 16:42 kosaki.motohiro
2013-10-30 15:20 ` Mel Gorman
0 siblings, 1 reply; 2+ messages in thread
From: kosaki.motohiro @ 2013-10-25 16:42 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, akpm, KOSAKI Motohiro, Mel Gorman
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
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.
Cc: Mel Gorman <mgorman@suse.de>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
include/trace/events/kmem.h | 10 ++++------
mm/page_alloc.c | 5 ++---
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index d0c6134..aece134 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -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",
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4414c9d..58e67ea 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1103,9 +1103,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;
}
--
1.7.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag()
2013-10-25 16:42 [PATCH] mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag() kosaki.motohiro
@ 2013-10-30 15:20 ` Mel Gorman
0 siblings, 0 replies; 2+ messages in thread
From: Mel Gorman @ 2013-10-30 15:20 UTC (permalink / raw)
To: kosaki.motohiro; +Cc: linux-kernel, linux-mm, akpm, KOSAKI Motohiro
On Fri, Oct 25, 2013 at 12:42:47PM -0400, kosaki.motohiro@gmail.com wrote:
> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>
> 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.
>
> Cc: Mel Gorman <mgorman@suse.de>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Mel Gorman <mgorman@suse.de>
--
Mel Gorman
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-30 15:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-25 16:42 [PATCH] mm: get rid of unnecessary overhead of trace_mm_page_alloc_extfrag() kosaki.motohiro
2013-10-30 15:20 ` Mel Gorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).