[PATCH 2/8] vmscan: tracing: Update trace event to track if page reclaim IO is for anon or file pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]