* sched: Set preferred NUMA node based on number of private faults
@ 2013-09-24 7:01 Figo.zhang
0 siblings, 0 replies; only message in thread
From: Figo.zhang @ 2013-09-24 7:01 UTC (permalink / raw)
To: Mel Gorman; +Cc: Linux-MM
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 4baf12e..8e2a364 100644
--- a/mm/mempolicy.c<https://git.kernel.org/cgit/linux/kernel/git/mel/linux-balancenuma.git/tree/mm/mempolicy.c?h=sched-numa-balancing-stick-v8r17&id=d182f60b02e670ca2add388813b499ce275a9222>
+++ b/mm/mempolicy.c<https://git.kernel.org/cgit/linux/kernel/git/mel/linux-balancenuma.git/tree/mm/mempolicy.c?h=sched-numa-balancing-stick-v8r17&id=e5c6a5c945780aae8ea4e034cb230d0407c06d04>
@@ -2292,9 +2292,11 @@ int mpol_misplaced(struct page *page, struct
vm_area_struct *vma, unsigned long
/* Migrate the page towards the node whose CPU is referencing it */
if (pol->flags & MPOL_F_MORON) {
- int last_nid;
+ int last_nidpid;
+ int this_nidpid;
polnid = numa_node_id();
+ this_nidpid = nid_pid_to_nidpid(polnid, current->pid);
/*
* Multi-stage node selection is used in conjunction
@@ -2317,8 +2319,8 @@ int mpol_misplaced(struct page *page, struct
vm_area_struct *vma, unsigned long
* it less likely we act on an unlikely task<->page
* relation.
*/
- last_nid = page_nid_xchg_last(page, polnid);
- if (last_nid != polnid)
+ last_nidpid = page_nidpid_xchg_last(page, this_nidpid);
+ if (!nidpid_pid_unset(last_nidpid) && nidpid_to_nid(last_nidpid) !=
polnid)
=>if the page is the first access, so nidpid_pid_unset(last_nidpid) return
true, so we should not check and migrate the first access page if curnid !=
polnid.
- last_nid = page_nid_xchg_last(page, polnid);
- if (last_nid != polnid)
+ last_nidpid = page_nidpid_xchg_last(page, this_nidpid);
+ if (nidpid_pid_unset(last_nidpid))
+ goto out;
+ else if (nidpid_to_nid(last_nidpid) != polnid)
[-- Attachment #2: Type: text/html, Size: 5337 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-24 7:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-24 7:01 sched: Set preferred NUMA node based on number of private faults Figo.zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox