]> git.baikalelectronics.ru Git - kernel.git/commit
mm: numa: serialise parallel get_user_page against THP migration
authorMel Gorman <mgorman@suse.de>
Thu, 19 Dec 2013 01:08:32 +0000 (17:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 19 Dec 2013 03:04:50 +0000 (19:04 -0800)
commit47dc817b6e3be7b9789a43bcc92166b84341bc17
treef5062cda19087b1d9a6830feffc4089aeb5b7fc8
parentd12e24a89a655574e7b4ba51f7d8d3c2dfca25f2
mm: numa: serialise parallel get_user_page against THP migration

Base pages are unmapped and flushed from cache and TLB during normal
page migration and replaced with a migration entry that causes any
parallel NUMA hinting fault or gup to block until migration completes.

THP does not unmap pages due to a lack of support for migration entries
at a PMD level.  This allows races with get_user_pages and
get_user_pages_fast which commit 356c0b023b09 ("mm: Close races between
THP migration and PMD numa clearing") made worse by introducing a
pmd_clear_flush().

This patch forces get_user_page (fast and normal) on a pmd_numa page to
go through the slow get_user_page path where it will serialise against
THP migration and properly account for the NUMA hinting fault.  On the
migration side the page table lock is taken for each PTE update.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/mm/gup.c
mm/huge_memory.c
mm/migrate.c