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?⒏?