lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 24 Nov 2012 12:17:03 +0800
From:	Hillf Danton <dhillf@...il.com>
To:	Mel Gorman <mgorman@...e.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Hillf Danton <dhillf@...il.com>
Subject: [PATCH 1/3] balancenuma: add stats for huge pmd numa faults

A thp contributes 512 times more than a regular page to numa fault stats,
so deserves its own vm event counter. THP migration is also accounted.

[A duplicated computation of page node idx is cleaned up]

Signed-off-by: Hillf Danton <dhillf@...il.com>
---

--- a/include/linux/vm_event_item.h	Fri Nov 23 21:24:12 2012
+++ b/include/linux/vm_event_item.h	Fri Nov 23 21:37:32 2012
@@ -40,6 +40,12 @@ enum vm_event_item { PGPGIN, PGPGOUT, PS
 		PAGEOUTRUN, ALLOCSTALL, PGROTATED,
 #ifdef CONFIG_BALANCE_NUMA
 		NUMA_PTE_UPDATES,
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+		NUMA_THP_HINT_FAULTS,
+		NUMA_THP_HINT_FAULTS_LOCAL,
+		NUMA_THP_MIGRATE_SUCCESS,
+		NUMA_THP_MIGRATE_FAIL,
+#endif
 		NUMA_HINT_FAULTS,
 		NUMA_HINT_FAULTS_LOCAL,
 		NUMA_PAGE_MIGRATE,
--- a/mm/huge_memory.c	Fri Nov 23 21:28:04 2012
+++ b/mm/huge_memory.c	Fri Nov 23 21:52:06 2012
@@ -1035,12 +1035,13 @@ int do_huge_pmd_numa_page(struct mm_stru

 	page = pmd_page(pmd);
 	get_page(page);
-	count_vm_numa_event(NUMA_HINT_FAULTS);
 	current_nid = page_to_nid(page);
+	count_vm_numa_event(NUMA_THP_HINT_FAULTS);
+	if (current_nid == numa_node_id())
+		count_vm_numa_event(NUMA_THP_HINT_FAULTS_LOCAL);

 	target_nid = mpol_misplaced(page, vma, haddr);
 	if (target_nid == -1) {
-		current_nid = page_to_nid(page);
 		put_page(page);
 		goto clear_pmdnuma;
 	}
@@ -1063,9 +1064,11 @@ int do_huge_pmd_numa_page(struct mm_stru
 	migrated = migrate_misplaced_transhuge_page(mm, vma,
 				pmdp, pmd, addr,
 				page, target_nid);
-	if (migrated)
+	if (migrated) {
+		count_vm_numa_event(NUMA_THP_MIGRATE_SUCCESS);
 		current_nid = target_nid;
-	else {
+	} else {
+		count_vm_numa_event(NUMA_THP_MIGRATE_FAIL);
 		spin_lock(&mm->page_table_lock);
 		if (unlikely(!pmd_same(pmd, *pmdp))) {
 			unlock_page(page);
--- a/mm/vmstat.c	Fri Nov 23 21:30:04 2012
+++ b/mm/vmstat.c	Fri Nov 23 21:57:32 2012
@@ -776,6 +776,12 @@ const char * const vmstat_text[] = {

 #ifdef CONFIG_BALANCE_NUMA
 	"numa_pte_updates",
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+	"numa_thp_hint_faults",
+	"numa_thp_hint_faults_local",
+	"numa_thp_migrated_success",
+	"numa_thp_migrated_fail",
+#endif
 	"numa_hint_faults",
 	"numa_hint_faults_local",
 	"numa_pages_migrated",
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ