Thread (10 messages) 10 messages, 3 authors, 2013-01-04

[RFC v4 3/3] add PGVOLATILE vmstat count

From: Minchan Kim <minchan@kernel.org>
Date: 2012-12-18 06:57:54
Also in: lkml
Subsystem: memory management, memory management - core, memory management - mglru (multi-gen lru), memory management - reclaim, the rest · Maintainers: Andrew Morton, David Hildenbrand, Johannes Weiner, Linus Torvalds

This patch add pgvolatile vmstat so admin can see how many of volatile
pages are discarded by VM until now. It could be a good indicator of
patch effect during test but still not sure we need it in real practice.
Will rethink it.

Cc: Michael Kerrisk <redacted>
Cc: Arun Sharma <redacted>
Cc: sanjay@google.com
Cc: Paul Turner <redacted>
CC: David Rientjes <rientjes@google.com>
Cc: John Stultz <redacted>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <redacted>
Cc: Android Kernel Team <redacted>
Cc: Robert Love <redacted>
Cc: Mel Gorman <redacted>
Cc: Hugh Dickins <hughd@google.com>
Cc: Dave Hansen <redacted>
Cc: Rik van Riel <redacted>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Neil Brown <redacted>
Cc: Mike Hommey <redacted>
Cc: Taras Glek <redacted>
Cc: KOSAKI Motohiro <redacted>
Cc: Christoph Lameter <redacted>
Cc: KAMEZAWA Hiroyuki <redacted>
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 include/linux/vm_event_item.h |    2 +-
 mm/vmscan.c                   |    1 +
 mm/vmstat.c                   |    1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 3d31145..f83c3d2 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -23,7 +23,7 @@
 
 enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
 		FOR_ALL_ZONES(PGALLOC),
-		PGFREE, PGACTIVATE, PGDEACTIVATE,
+		PGFREE, PGVOLATILE, PGACTIVATE, PGDEACTIVATE,
 		PGFAULT, PGMAJFAULT,
 		FOR_ALL_ZONES(PGREFILL),
 		FOR_ALL_ZONES(PGSTEAL_KSWAPD),
diff --git a/mm/vmscan.c b/mm/vmscan.c
index cfe95d3..1ec7345 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -794,6 +794,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 		if (page_mapped(page) && mapping) {
 			switch (try_to_unmap(page, ttu_flags)) {
 			case SWAP_DISCARD:
+				count_vm_event(PGVOLATILE);
 				goto discard_page;
 			case SWAP_FAIL:
 				goto activate_locked;
diff --git a/mm/vmstat.c b/mm/vmstat.c
index c737057..9fd8ead 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -747,6 +747,7 @@ const char * const vmstat_text[] = {
 	TEXTS_FOR_ZONES("pgalloc")
 
 	"pgfree",
+	"pgvolatile",
 	"pgactivate",
 	"pgdeactivate",
 
-- 
1.7.9.5

--
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/ .
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