Thread (21 messages) 21 messages, 5 authors, 2011-02-18

Re: [PATCH v5 4/4] add profile information for invalidated page

From: Mel Gorman <hidden>
Date: 2011-02-18 16:58:58
Also in: lkml

On Fri, Feb 18, 2011 at 12:08:22AM +0900, Minchan Kim wrote:
quoted hunk ↗ jump to hunk
This patch adds profile information about invalidated page reclaim.
It's just for profiling for test so it is never for merging.

Acked-by: Rik van Riel <redacted>
Cc: KOSAKI Motohiro <redacted>
Cc: Wu Fengguang <redacted>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nick Piggin <redacted>
Cc: Mel Gorman <redacted>
Signed-off-by: Minchan Kim <redacted>
---
 include/linux/vmstat.h |    4 ++--
 mm/swap.c              |    3 +++
 mm/vmstat.c            |    3 +++
 3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 833e676..c38ad95 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -30,8 +30,8 @@
 
 enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
 		FOR_ALL_ZONES(PGALLOC),
-		PGFREE, PGACTIVATE, PGDEACTIVATE,
-		PGFAULT, PGMAJFAULT,
+		PGFREE, PGACTIVATE, PGDEACTIVATE, PGINVALIDATE,
+		PGRECLAIM, PGFAULT, PGMAJFAULT,
 		FOR_ALL_ZONES(PGREFILL),
 		FOR_ALL_ZONES(PGSTEAL),
 		FOR_ALL_ZONES(PGSCAN_KSWAPD),
diff --git a/mm/swap.c b/mm/swap.c
index 0a33714..980c17b 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -397,6 +397,7 @@ static void lru_deactivate(struct page *page, struct zone *zone)
 		 * is _really_ small and  it's non-critical problem.
 		 */
 		SetPageReclaim(page);
+		__count_vm_event(PGRECLAIM);
 	} else {
 		/*
 		 * The page's writeback ends up during pagevec
Is this name potentially misleading?

Pages that are reclaimed are accounted for with _steal. It's not particularly
obvious but that's the name it was given. I'd worry that an administrator that
was not aware of *_steal would read pgreclaim as "pages that were reclaimed"
when this is not necessarily the case.

Is there a better name for this? pginvalidate_deferred
or pginvalidate_delayed maybe?
quoted hunk ↗ jump to hunk
@@ -409,6 +410,8 @@ static void lru_deactivate(struct page *page, struct zone *zone)
 
 	if (active)
 		__count_vm_event(PGDEACTIVATE);
+
+	__count_vm_event(PGINVALIDATE);
 	update_page_reclaim_stat(zone, page, file, 0);
 }
 
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 0c3b504..cbe032b 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -896,6 +896,9 @@ static const char * const vmstat_text[] = {
 	"pgactivate",
 	"pgdeactivate",
 
+	"pginvalidate",
+	"pgreclaim",
+
 	"pgfault",
 	"pgmajfault",
 
-- 
1.7.1
-- 
Mel Gorman
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help