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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

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@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

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/8] vmscan: tracing: Update trace event to track i ..., Mel Gorman, (Mon Jul 19, 6:11 am)
Re: [PATCH 4/8] vmscan: Do not writeback filesystem pages ..., Christoph Hellwig, (Mon Jul 19, 7:19 am)
Re: [PATCH 7/8] writeback: sync old inodes first in backgr ..., Christoph Hellwig, (Mon Jul 19, 7:21 am)
Re: [PATCH 8/8] vmscan: Kick flusher threads to clean page ..., Christoph Hellwig, (Mon Jul 19, 7:23 am)
Re: [PATCH 2/8] vmscan: tracing: Update trace event to tra ..., Christoph Hellwig, (Mon Jul 19, 7:26 am)
Re: [PATCH 7/8] writeback: sync old inodes first in backgr ..., Christoph Hellwig, (Mon Jul 19, 7:48 am)
Re: [PATCH 5/8] fs,btrfs: Allow kswapd to writeback pages, Rik van Riel, (Mon Jul 19, 11:27 am)
Re: [PATCH 4/8] vmscan: Do not writeback filesystem pages ..., KAMEZAWA Hiroyuki, (Wed Jul 21, 5:01 am)
Re: [PATCH 4/8] vmscan: Do not writeback filesystem pages ..., KAMEZAWA Hiroyuki, (Wed Jul 21, 4:57 pm)
Re: [PATCH 4/8] vmscan: Do not writeback filesystem pages ..., KAMEZAWA Hiroyuki, (Thu Jul 22, 2:22 am)