From: Mel Gorman on
It is useful to distinguish between IO for anon and file pages. This
patch updates
vmscan-tracing-add-trace-event-when-a-page-is-written.patch to include
that information. The patches can be merged together.

Signed-off-by: Mel Gorman <mel(a)csn.ul.ie>
---
include/trace/events/vmscan.h | 8 ++++++--
mm/vmscan.c | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index f2da66a..110aea2 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -158,23 +158,27 @@ TRACE_EVENT(mm_vmscan_lru_isolate,
TRACE_EVENT(mm_vmscan_writepage,

TP_PROTO(struct page *page,
+ int file,
int sync_io),

- TP_ARGS(page, sync_io),
+ TP_ARGS(page, file, sync_io),

TP_STRUCT__entry(
__field(struct page *, page)
+ __field(int, file)
__field(int, sync_io)
),

TP_fast_assign(
__entry->page = page;
+ __entry->file = file;
__entry->sync_io = sync_io;
),

- TP_printk("page=%p pfn=%lu sync_io=%d",
+ TP_printk("page=%p pfn=%lu file=%d sync_io=%d",
__entry->page,
page_to_pfn(__entry->page),
+ __entry->file,
__entry->sync_io)
);

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e6ddba9..6587155 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -400,6 +400,7 @@ static pageout_t pageout(struct page *page, struct address_space *mapping,
ClearPageReclaim(page);
}
trace_mm_vmscan_writepage(page,
+ page_is_file_cache(page),
sync_writeback == PAGEOUT_IO_SYNC);
inc_zone_page_state(page, NR_VMSCAN_WRITE);
return PAGE_SUCCESS;
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/