aboutsummaryrefslogtreecommitdiff
path: root/lib/memory-notifier-error-inject.c
diff options
context:
space:
mode:
authorMel Gorman <[email protected]>2013-10-07 11:28:43 +0100
committerIngo Molnar <[email protected]>2013-10-29 11:37:19 +0100
commit42836f5f8baa33085f547098b74aa98991ee9216 (patch)
treea085681ed2bb266b28bc94210eecd95c0ec2ea0c /lib/memory-notifier-error-inject.c
parent1dd49bfa3465756b3ce72214b58a33e4afb67aa3 (diff)
mm: Wait for THP migrations to complete during NUMA hinting faults
The locking for migrating THP is unusual. While normal page migration prevents parallel accesses using a migration PTE, THP migration relies on a combination of the page_table_lock, the page lock and the existance of the NUMA hinting PTE to guarantee safety but there is a bug in the scheme. If a THP page is currently being migrated and another thread traps a fault on the same page it checks if the page is misplaced. If it is not, then pmd_numa is cleared. The problem is that it checks if the page is misplaced without holding the page lock meaning that the racing thread can be migrating the THP when the second thread clears the NUMA bit and faults a stale page. This patch checks if the page is potentially being migrated and stalls using the lock_page if it is potentially being migrated before checking if the page is misplaced or not. Signed-off-by: Mel Gorman <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Srikar Dronamraju <[email protected]> Cc: <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions