diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 68d5c7f7164e..784c11ef7719 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -2377,37 +2377,10 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long | |||
2377 | 2377 | ||
2378 | /* Migrate the page towards the node whose CPU is referencing it */ | 2378 | /* Migrate the page towards the node whose CPU is referencing it */ |
2379 | if (pol->flags & MPOL_F_MORON) { | 2379 | if (pol->flags & MPOL_F_MORON) { |
2380 | int last_cpupid; | ||
2381 | int this_cpupid; | ||
2382 | |||
2383 | polnid = thisnid; | 2380 | polnid = thisnid; |
2384 | this_cpupid = cpu_pid_to_cpupid(thiscpu, current->pid); | ||
2385 | 2381 | ||
2386 | /* | 2382 | if (!should_numa_migrate_memory(current, page, curnid, thiscpu)) |
2387 | * Multi-stage node selection is used in conjunction | ||
2388 | * with a periodic migration fault to build a temporal | ||
2389 | * task<->page relation. By using a two-stage filter we | ||
2390 | * remove short/unlikely relations. | ||
2391 | * | ||
2392 | * Using P(p) ~ n_p / n_t as per frequentist | ||
2393 | * probability, we can equate a task's usage of a | ||
2394 | * particular page (n_p) per total usage of this | ||
2395 | * page (n_t) (in a given time-span) to a probability. | ||
2396 | * | ||
2397 | * Our periodic faults will sample this probability and | ||
2398 | * getting the same result twice in a row, given these | ||
2399 | * samples are fully independent, is then given by | ||
2400 | * P(n)^2, provided our sample period is sufficiently | ||
2401 | * short compared to the usage pattern. | ||
2402 | * | ||
2403 | * This quadric squishes small probabilities, making | ||
2404 | * it less likely we act on an unlikely task<->page | ||
2405 | * relation. | ||
2406 | */ | ||
2407 | last_cpupid = page_cpupid_xchg_last(page, this_cpupid); | ||
2408 | if (!cpupid_pid_unset(last_cpupid) && cpupid_to_nid(last_cpupid) != thisnid) { | ||
2409 | goto out; | 2383 | goto out; |
2410 | } | ||
2411 | } | 2384 | } |
2412 | 2385 | ||
2413 | if (curnid != polnid) | 2386 | if (curnid != polnid) |