linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Schermerhorn <lee.schermerhorn@hp.com>
To: linux-numa@vger.kernel.org
Cc: akpm@linux-foundation.org, Mel Gorman <mel@csn.ul.ie>,
	cl@linux-foundation.org, Nick Piggin <npiggin@kernel.dk>,
	Hugh Dickins <hughd@google.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	andi@firstfloor.org, David Rientjes <rientjes@google.com>,
	Avi Kivity <avi@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: [PATCH/RFC 8/8] numa - Migrate-on-Fault - add statistics
Date: Thu, 11 Nov 2010 14:45:56 -0500	[thread overview]
Message-ID: <20101111194556.12535.29339.sendpatchset@zaphod.localdomain> (raw)
In-Reply-To: <20101111194450.12535.12611.sendpatchset@zaphod.localdomain>

PATCH Migrate-on-fault 8/8 - add statistics

Count migrate-on-fault events:

+ pglocchecked -- page location checked for misplacement
+ pgmisplaced  -- page misplaced -- location != policy
+ pgmigrated   -- page successfully migrated

Note:  currently, pgmigrated is only counted when migrate-on-fault
is configured.  However, it will count all successful migrations,
including "direct" migrations.  This should be promoted to depend
only on CONFIG_MIGRATE.

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>

 include/linux/vmstat.h |    3 +++
 mm/migrate.c           |   11 +++++++++++
 mm/vmstat.c            |    5 +++++
 3 files changed, 19 insertions(+)

Index: linux-2.6.36-mmotm-101103-1217/include/linux/vmstat.h
===================================================================
--- linux-2.6.36-mmotm-101103-1217.orig/include/linux/vmstat.h
+++ linux-2.6.36-mmotm-101103-1217/include/linux/vmstat.h
@@ -58,6 +58,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PS
 		UNEVICTABLE_PGCLEARED,	/* on COW, page truncate */
 		UNEVICTABLE_PGSTRANDED,	/* unable to isolate on unlock */
 		UNEVICTABLE_MLOCKFREED,
+#ifdef CONFIG_MIGRATE_ON_FAULT
+		PGLOCCHECK, PGMISPLACED, PGMIGRATED,
+#endif
 		NR_VM_EVENT_ITEMS
 };
 
Index: linux-2.6.36-mmotm-101103-1217/mm/vmstat.c
===================================================================
--- linux-2.6.36-mmotm-101103-1217.orig/mm/vmstat.c
+++ linux-2.6.36-mmotm-101103-1217/mm/vmstat.c
@@ -864,6 +864,11 @@ static const char * const vmstat_text[]
 	"unevictable_pgs_cleared",
 	"unevictable_pgs_stranded",
 	"unevictable_pgs_mlockfreed",
+#ifdef CONFIG_MIGRATE_ON_FAULT
+	"pglocchecked",
+	"pgmisplaced",
+	"pgmigrated",
+#endif
 #endif
 };
 
Index: linux-2.6.36-mmotm-101103-1217/mm/migrate.c
===================================================================
--- linux-2.6.36-mmotm-101103-1217.orig/mm/migrate.c
+++ linux-2.6.36-mmotm-101103-1217/mm/migrate.c
@@ -34,6 +34,7 @@
 #include <linux/syscalls.h>
 #include <linux/hugetlb.h>
 #include <linux/gfp.h>
+#include <linux/vmstat.h>
 
 #include "internal.h"
 
@@ -410,6 +411,14 @@ void migrate_page_copy(struct page *newp
 	 */
 	if (PageWriteback(newpage))
 		end_page_writeback(newpage);
+
+	/*
+	 * all successful migrations come through here.
+	 */
+#ifdef CONFIG_MIGRATE_ON_FAULT
+//TODO:  promote statistics to CONFIG_MIGRATE?
+	count_vm_event(PGMIGRATED);
+#endif
 }
 
 /************************************************************
@@ -1586,10 +1595,12 @@ struct page *check_migrate_misplaced_pag
 			!page_mapping(page)->a_ops->migratepage)
 		return page;
 
+	count_vm_event(PGLOCCHECK);
 	misplaced = mpol_misplaced(page, vma, address, &polnid);
 	if (!misplaced)
 		return page;
 
+	count_vm_event(PGMISPLACED);
 	return migrate_misplaced_page(page, vma->vm_mm, polnid,
 			misplaced_is_interleaved(misplaced));
 

  parent reply	other threads:[~2010-11-11 19:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 19:44 [PATCH/RFC 0/8] numa - Migrate-on-Fault Lee Schermerhorn
2010-11-11 19:44 ` [PATCH/RFC 1/8] numa - Migrate-on-Fault - add Kconfig option Lee Schermerhorn
2010-11-11 19:45 ` [PATCH/RFC 2/8] numa - Migrate-on-Fault - add cpuset control Lee Schermerhorn
2010-11-11 19:45 ` [PATCH/RFC 3/8] numa - Migrate-on-Fault - check for misplaced page Lee Schermerhorn
2010-11-11 19:45 ` [PATCH/RFC 4/8] numa - Migrate-on-Fault - migrate misplaced pages Lee Schermerhorn
2010-11-11 19:45 ` [PATCH/RFC 5/8] numa - Migrate-on-Fault - migrate misplaced anon pages Lee Schermerhorn
2010-11-11 19:45 ` [PATCH/RFC 6/8] numa - Migrate-on-Fault - add mbind() MPOL_MF_LAZY flag Lee Schermerhorn
2010-11-11 19:45 ` [PATCH/RFC 7/8] numa - Migrate-on-Fault - mbind() NOOP policy Lee Schermerhorn
2010-11-11 19:45 ` Lee Schermerhorn [this message]
2010-11-14  6:37 ` [PATCH/RFC 0/8] numa - Migrate-on-Fault KOSAKI Motohiro
2010-11-15 14:13   ` Christoph Lameter
2010-11-15 14:21     ` Andi Kleen
2010-11-15 14:37       ` Andrea Arcangeli
2010-11-15 14:33     ` Andrea Arcangeli
2010-11-17 17:03       ` Lee Schermerhorn
2010-11-17 21:27         ` Andrea Arcangeli
2010-11-16  4:54     ` KOSAKI Motohiro
2010-11-17 14:45       ` Lee Schermerhorn
2010-11-17 17:10 ` Avi Kivity
2010-11-17 17:34   ` Lee Schermerhorn

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=20101111194556.12535.29339.sendpatchset@zaphod.localdomain \
    --to=lee.schermerhorn@hp.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=avi@redhat.com \
    --cc=cl@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-numa@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=npiggin@kernel.dk \
    --cc=rientjes@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).