aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 0e895a2eed5f..a5867ef24bda 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2324,6 +2324,8 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
2324 struct zone *zone; 2324 struct zone *zone;
2325 int curnid = page_to_nid(page); 2325 int curnid = page_to_nid(page);
2326 unsigned long pgoff; 2326 unsigned long pgoff;
2327 int thiscpu = raw_smp_processor_id();
2328 int thisnid = cpu_to_node(thiscpu);
2327 int polnid = -1; 2329 int polnid = -1;
2328 int ret = -1; 2330 int ret = -1;
2329 2331
@@ -2372,11 +2374,11 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
2372 2374
2373 /* Migrate the page towards the node whose CPU is referencing it */ 2375 /* Migrate the page towards the node whose CPU is referencing it */
2374 if (pol->flags & MPOL_F_MORON) { 2376 if (pol->flags & MPOL_F_MORON) {
2375 int last_nidpid; 2377 int last_cpupid;
2376 int this_nidpid; 2378 int this_cpupid;
2377 2379
2378 polnid = numa_node_id(); 2380 polnid = thisnid;
2379 this_nidpid = nid_pid_to_nidpid(polnid, current->pid); 2381 this_cpupid = cpu_pid_to_cpupid(thiscpu, current->pid);
2380 2382
2381 /* 2383 /*
2382 * Multi-stage node selection is used in conjunction 2384 * Multi-stage node selection is used in conjunction
@@ -2399,8 +2401,8 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
2399 * it less likely we act on an unlikely task<->page 2401 * it less likely we act on an unlikely task<->page
2400 * relation. 2402 * relation.
2401 */ 2403 */
2402 last_nidpid = page_nidpid_xchg_last(page, this_nidpid); 2404 last_cpupid = page_cpupid_xchg_last(page, this_cpupid);
2403 if (!nidpid_pid_unset(last_nidpid) && nidpid_to_nid(last_nidpid) != polnid) 2405 if (!cpupid_pid_unset(last_cpupid) && cpupid_to_nid(last_cpupid) != thisnid)
2404 goto out; 2406 goto out;
2405 2407
2406#ifdef CONFIG_NUMA_BALANCING 2408#ifdef CONFIG_NUMA_BALANCING
@@ -2410,7 +2412,7 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
2410 * This way a short and temporary process migration will 2412 * This way a short and temporary process migration will
2411 * not cause excessive memory migration. 2413 * not cause excessive memory migration.
2412 */ 2414 */
2413 if (polnid != current->numa_preferred_nid && 2415 if (thisnid != current->numa_preferred_nid &&
2414 !current->numa_migrate_seq) 2416 !current->numa_migrate_seq)
2415 goto out; 2417 goto out;
2416#endif 2418#endif