Skip to content

Commit

Permalink
mm/vmscan.c: change trace_mm_vmscan_writepage() proto type
Browse files Browse the repository at this point in the history
Move trace_reclaim_flags() into trace function, so that we don't need
caculate these flags if the trace is disabled.

Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
yalin wang authored and Linus Torvalds committed Jan 15, 2016
1 parent 0b57d6b commit 3aa2385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions include/trace/events/vmscan.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,9 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,

TRACE_EVENT(mm_vmscan_writepage,

TP_PROTO(struct page *page,
int reclaim_flags),
TP_PROTO(struct page *page),

TP_ARGS(page, reclaim_flags),
TP_ARGS(page),

TP_STRUCT__entry(
__field(unsigned long, pfn)
Expand All @@ -342,7 +341,7 @@ TRACE_EVENT(mm_vmscan_writepage,

TP_fast_assign(
__entry->pfn = page_to_pfn(page);
__entry->reclaim_flags = reclaim_flags;
__entry->reclaim_flags = trace_reclaim_flags(page);
),

TP_printk("page=%p pfn=%lu flags=%s",
Expand Down
2 changes: 1 addition & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping,
/* synchronous write or broken a_ops? */
ClearPageReclaim(page);
}
trace_mm_vmscan_writepage(page, trace_reclaim_flags(page));
trace_mm_vmscan_writepage(page);
inc_zone_page_state(page, NR_VMSCAN_WRITE);
return PAGE_SUCCESS;
}
Expand Down

0 comments on commit 3aa2385

Please sign in to comment.