All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Minchan Kim <minchan@kernel.org>
Subject: [RFC 6/8] add PGVOLATILE vmstat count
Date: Thu,  3 Jan 2013 13:28:04 +0900	[thread overview]
Message-ID: <1357187286-18759-7-git-send-email-minchan@kernel.org> (raw)
In-Reply-To: <1357187286-18759-1-git-send-email-minchan@kernel.org>

This patch add pgvolatile vmstat so admin can see how many of volatile
pages are discarded by VM until now.

Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 include/linux/vm_event_item.h |    3 +++
 mm/mvolatile.c                |    1 +
 mm/vmstat.c                   |    3 +++
 3 files changed, 7 insertions(+)

diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 3d31145..721d096 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -25,6 +25,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
 		FOR_ALL_ZONES(PGALLOC),
 		PGFREE, PGACTIVATE, PGDEACTIVATE,
 		PGFAULT, PGMAJFAULT,
+#ifdef CONFIG_VOLATILE_PAGE
+		PGVOLATILE,
+#endif
 		FOR_ALL_ZONES(PGREFILL),
 		FOR_ALL_ZONES(PGSTEAL_KSWAPD),
 		FOR_ALL_ZONES(PGSTEAL_DIRECT),
diff --git a/mm/mvolatile.c b/mm/mvolatile.c
index 6bc9f7e..c66c3bc 100644
--- a/mm/mvolatile.c
+++ b/mm/mvolatile.c
@@ -201,6 +201,7 @@ int discard_volatile_page(struct page *page, enum ttu_flags ttu_flags)
 	if (try_to_volatile_page(page, ttu_flags)) {
 		if (page_freeze_refs(page, 1)) {
 			unlock_page(page);
+			count_vm_event(PGVOLATILE);
 			return 1;
 		}
 	}
diff --git a/mm/vmstat.c b/mm/vmstat.c
index c737057..3d08e1a 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -753,6 +753,9 @@ const char * const vmstat_text[] = {
 	"pgfault",
 	"pgmajfault",
 
+#ifdef CONFIG_VOLATILE_PAGE
+	"pgvolatile",
+#endif
 	TEXTS_FOR_ZONES("pgrefill")
 	TEXTS_FOR_ZONES("pgsteal_kswapd")
 	TEXTS_FOR_ZONES("pgsteal_direct")
-- 
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>

WARNING: multiple messages have this Message-ID (diff)
From: Minchan Kim <minchan@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Minchan Kim <minchan@kernel.org>
Subject: [RFC 6/8] add PGVOLATILE vmstat count
Date: Thu,  3 Jan 2013 13:28:04 +0900	[thread overview]
Message-ID: <1357187286-18759-7-git-send-email-minchan@kernel.org> (raw)
In-Reply-To: <1357187286-18759-1-git-send-email-minchan@kernel.org>

This patch add pgvolatile vmstat so admin can see how many of volatile
pages are discarded by VM until now.

Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 include/linux/vm_event_item.h |    3 +++
 mm/mvolatile.c                |    1 +
 mm/vmstat.c                   |    3 +++
 3 files changed, 7 insertions(+)

diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 3d31145..721d096 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -25,6 +25,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
 		FOR_ALL_ZONES(PGALLOC),
 		PGFREE, PGACTIVATE, PGDEACTIVATE,
 		PGFAULT, PGMAJFAULT,
+#ifdef CONFIG_VOLATILE_PAGE
+		PGVOLATILE,
+#endif
 		FOR_ALL_ZONES(PGREFILL),
 		FOR_ALL_ZONES(PGSTEAL_KSWAPD),
 		FOR_ALL_ZONES(PGSTEAL_DIRECT),
diff --git a/mm/mvolatile.c b/mm/mvolatile.c
index 6bc9f7e..c66c3bc 100644
--- a/mm/mvolatile.c
+++ b/mm/mvolatile.c
@@ -201,6 +201,7 @@ int discard_volatile_page(struct page *page, enum ttu_flags ttu_flags)
 	if (try_to_volatile_page(page, ttu_flags)) {
 		if (page_freeze_refs(page, 1)) {
 			unlock_page(page);
+			count_vm_event(PGVOLATILE);
 			return 1;
 		}
 	}
diff --git a/mm/vmstat.c b/mm/vmstat.c
index c737057..3d08e1a 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -753,6 +753,9 @@ const char * const vmstat_text[] = {
 	"pgfault",
 	"pgmajfault",
 
+#ifdef CONFIG_VOLATILE_PAGE
+	"pgvolatile",
+#endif
 	TEXTS_FOR_ZONES("pgrefill")
 	TEXTS_FOR_ZONES("pgsteal_kswapd")
 	TEXTS_FOR_ZONES("pgsteal_direct")
-- 
1.7.9.5


  parent reply	other threads:[~2013-01-03  4:28 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03  4:27 [RFC v5 0/8] Support volatile for anonymous range Minchan Kim
2013-01-03  4:27 ` Minchan Kim
2013-01-03  4:27 ` [RFC 1/8] Introduce new system call mvolatile Minchan Kim
2013-01-03  4:27   ` Minchan Kim
2013-01-03 18:35   ` Taras Glek
2013-01-03 18:35     ` Taras Glek
2013-01-04  4:25     ` Minchan Kim
2013-01-04  4:25       ` Minchan Kim
2013-01-17  1:48   ` John Stultz
2013-01-17  1:48     ` John Stultz
2013-01-18  5:30     ` Minchan Kim
2013-01-18  5:30       ` Minchan Kim
2013-01-03  4:28 ` [RFC 2/8] Don't allow volatile attribute on THP and KSM Minchan Kim
2013-01-03  4:28   ` Minchan Kim
2013-01-03 16:27   ` Dave Hansen
2013-01-03 16:27     ` Dave Hansen
2013-01-04  2:51     ` Minchan Kim
2013-01-04  2:51       ` Minchan Kim
2013-01-03  4:28 ` [RFC 3/8] bail out when the page is in VOLATILE vma Minchan Kim
2013-01-03  4:28   ` Minchan Kim
2013-01-03  4:28 ` [RFC 4/8] add page_locked parameter in free_swap_and_cache Minchan Kim
2013-01-03  4:28   ` Minchan Kim
2013-01-03  4:28 ` [RFC 5/8] Discard volatile page Minchan Kim
2013-01-03  4:28   ` Minchan Kim
2013-01-03  4:28 ` Minchan Kim [this message]
2013-01-03  4:28   ` [RFC 6/8] add PGVOLATILE vmstat count Minchan Kim
2013-01-03  4:28 ` [RFC 7/8] add volatile page discard hook to kswapd Minchan Kim
2013-01-03  4:28   ` Minchan Kim
2013-01-03  4:28 ` [RFC 8/8] extend PGVOLATILE vmstat " Minchan Kim
2013-01-03  4:28   ` Minchan Kim
2013-01-03 17:19 ` [RFC v5 0/8] Support volatile for anonymous range Sanjay Ghemawat
2013-01-03 17:19   ` Sanjay Ghemawat
2013-01-04  5:15   ` Minchan Kim
2013-01-04  5:15     ` Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1357187286-18759-7-git-send-email-minchan@kernel.org \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.