linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thp: avoid VM_BUG_ON page_count(page) false positives in __collapse_huge_page_copy
@ 2012-09-28 12:35 Andrea Arcangeli
  2012-09-28 15:14 ` Rik van Riel
  2012-09-28 15:31 ` Johannes Weiner
  0 siblings, 2 replies; 5+ messages in thread
From: Andrea Arcangeli @ 2012-09-28 12:35 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-mm, Rik van Riel, Johannes Weiner, Hugh Dickins, Mel Gorman,
	Petr Holasek

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>
---
 mm/huge_memory.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 1598708..ad56497 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1814,7 +1814,6 @@ static void __collapse_huge_page_copy(pte_t *pte, struct page *page,
 			src_page = pte_page(pteval);
 			copy_user_highpage(page, src_page, address, vma);
 			VM_BUG_ON(page_mapcount(src_page) != 1);
-			VM_BUG_ON(page_count(src_page) != 2);
 			release_pte_page(src_page);
 			/*
 			 * ptl mostly unnecessary, but preempt has to

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] thp: avoid VM_BUG_ON page_count(page) false positives in __collapse_huge_page_copy
@ 2012-09-25 18:11 Andrea Arcangeli
  2012-09-25 18:11 ` Andrea Arcangeli
  0 siblings, 1 reply; 5+ messages in thread
From: Andrea Arcangeli @ 2012-09-25 18:11 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, Rik van Riel, Johannes Weiner, Hugh Dickins, Mel Gorman,
	Petr Holasek

Some time ago Petr once reproduced a false positive VM_BUG_ON in
khugepaged while running the autonuma-benchmark on a large 8 node
system. All production kernels out there have DEBUG_VM=n so it was
only noticeable on self built kernels. It's not easily reproducible
even on the 8 nodes system.

This patch removes the false positive and it has been tested for a
while and it's good idea to queue it for upstream too. It's not urgent
and probably not worth it for -stable, though it wouldn't hurt. On
smaller systems it's not reproducible AFIK.

Andrea Arcangeli (1):
  thp: avoid VM_BUG_ON page_count(page) false positives in
    __collapse_huge_page_copy

 mm/huge_memory.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-28 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 12:35 [PATCH] thp: avoid VM_BUG_ON page_count(page) false positives in __collapse_huge_page_copy Andrea Arcangeli
2012-09-28 15:14 ` Rik van Riel
2012-09-28 15:31 ` Johannes Weiner
  -- strict thread matches above, loose matches on Subject: below --
2012-09-25 18:11 Andrea Arcangeli
2012-09-25 18:11 ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).