lkml.org 
[lkml]   [2009]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] tracing, page-allocator: Add trace events for page allocation and page freeing

* Mel Gorman <mel@csn.ul.ie> wrote:

> +TRACE_EVENT(mm_pagevec_free,

> + TP_fast_assign(
> + __entry->page = page;
> + __entry->order = order;
> + __entry->cold = cold;
> + ),

> - while (--i >= 0)
> + while (--i >= 0) {
> + trace_mm_pagevec_free(pvec->pages[i], 0, pvec->cold);
> free_hot_cold_page(pvec->pages[i], pvec->cold);
> + }

Pagevec freeing has order 0 implicit, so you can further optimize
this by leaving out the 'order' field and using this format string:

+ TP_printk("page=%p pfn=%lu order=0 cold=%d",
+ __entry->page,
+ page_to_pfn(__entry->page),
+ __entry->cold)

the trace record becomes smaller by 4 bytes and the tracepoint
fastpath becomes shorter as well.

Ingo


\
 
 \ /
  Last update: 2009-08-07 09:53    [W:2.166 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site