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 <mtk.manpa...@gmail.com>
Cc: Arun Sharma <asha...@fb.com>
Cc: san...@google.com
Cc: Paul Turner <p...@google.com>
CC: David Rientjes <rient...@google.com>
Cc: John Stultz <john.stu...@linaro.org>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Christoph Lameter <c...@linux.com>
Cc: Android Kernel Team <kernel-t...@android.com>
Cc: Robert Love <rl...@google.com>
Cc: Mel Gorman <m...@csn.ul.ie>
Cc: Hugh Dickins <hu...@google.com>
Cc: Dave Hansen <d...@linux.vnet.ibm.com>
Cc: Rik van Riel <r...@redhat.com>
Cc: Dave Chinner <da...@fromorbit.com>
Cc: Neil Brown <ne...@suse.de>
Cc: Mike Hommey <m...@glandium.org>
Cc: Taras Glek <tg...@mozilla.com>
Cc: KOSAKI Motohiro <kosaki.motoh...@gmail.com>
Cc: Christoph Lameter <c...@linux.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hir...@jp.fujitsu.com>
Signed-off-by: Minchan Kim <minc...@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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to