[PATCH/RFC 8/8] numa - Migrate-on-Fault - add statistics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>

 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));
 
--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux