[RFC PATCH] ANB(Automatic NUMA Balancing): erase mm footprint of migrated page

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

 



If a page monitored by ANB is migrated, its footprint should be erased from
numa-hint-fault account, because it is no longer used. Or two pages, the
migrated page and its target page, are used in the view of task placement.


Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
---

--- a/kernel/sched/fair.c	Wed Sep 11 18:33:00 2013
+++ b/kernel/sched/fair.c	Fri Sep 13 08:24:24 2013
@@ -1560,6 +1560,20 @@ void task_numa_fault(int last_cpupid, in
 		p->numa_pages_migrated += pages;
 
 	p->numa_faults_buffer[task_faults_idx(node, priv)] += pages;
+
+	if (migrated && last_cpupid != (-1 & LAST_CPUPID_MASK)) {
+		/* Erase footprint of migrated page */
+		int idx;
+
+		idx = cpupid_to_cpu(last_cpupid);
+		idx = cpu_to_node(idx);
+		idx = task_faults_idx(idx, priv);
+
+		if (p->numa_faults_buffer[idx] >= pages)
+		    p->numa_faults_buffer[idx] -= pages;
+		else if (p->numa_faults_buffer[idx])
+			 p->numa_faults_buffer[idx] = 0;
+	}
 }
 
 static void reset_ptenuma_scan(struct task_struct *p)
--?韬{.n?壏?檩jg??a旃??迻)钋?韰骅w+h櫒璀?y/i?⒏?婃⒎?湼Щ烚m???)钋?痂燐^櫒?觥櫒ザ?v夗﨣趓O璁?f?i?⒏?




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]