aboutsummaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2012-09-28 08:35:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-09-28 11:38:09 -0400
commit99a1300e1d84709f419182bb5189760e78234882 (patch)
tree1d3cc49d4015fbb2b3d5bbeed313d30d7756526b /mm/huge_memory.c
parent63994137eb53bb0fc42ad180c0ce509d3eb3bdc9 (diff)
thp: avoid VM_BUG_ON page_count(page) false positives in __collapse_huge_page_copy
Speculative cache pagecache lookups can elevate the refcount from under us, so avoid the false positive. If the refcount is < 2 we'll be notified by a VM_BUG_ON in put_page_testzero as there are two put_page(src_page) in a row before returning from this function. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Reviewed-by: Rik van Riel <riel@redhat.com> Reviewed-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Hugh Dickins <hughd@google.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Petr Holasek <pholasek@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 57c4b9309015..141dbb695097 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1811,7 +1811,6 @@ static void __collapse_huge_page_copy(pte_t *pte, struct page *page,
1811 src_page = pte_page(pteval); 1811 src_page = pte_page(pteval);
1812 copy_user_highpage(page, src_page, address, vma); 1812 copy_user_highpage(page, src_page, address, vma);
1813 VM_BUG_ON(page_mapcount(src_page) != 1); 1813 VM_BUG_ON(page_mapcount(src_page) != 1);
1814 VM_BUG_ON(page_count(src_page) != 2);
1815 release_pte_page(src_page); 1814 release_pte_page(src_page);
1816 /* 1815 /*
1817 * ptl mostly unnecessary, but preempt has to 1816 * ptl mostly unnecessary, but preempt has to