Hugh Dickins f18194275c mm: fix hang on anon_vma->root->lock
After several hours, kbuild tests hang with anon_vma_prepare() spinning on
a newly allocated anon_vma's lock - on a box with CONFIG_TREE_PREEMPT_RCU=y
(which makes this very much more likely, but it could happen without).

The ever-subtle page_lock_anon_vma() now needs a further twist: since
anon_vma_prepare() and anon_vma_fork() are liable to change the ->root
of a reused anon_vma structure at any moment, page_lock_anon_vma()
needs to check page_mapped() again before succeeding, otherwise
page_unlock_anon_vma() might address a different root->lock.

Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-28 13:54:12 -07:00
..
2009-04-01 08:59:13 -07:00
2010-03-06 11:26:23 -08:00
2010-07-14 17:14:00 +10:00
2010-08-08 21:57:23 +01:00
2010-08-09 20:45:03 -07:00
2010-07-14 17:14:00 +10:00
2009-09-22 07:17:35 -07:00
2010-05-25 08:06:58 -07:00
2010-08-24 12:13:20 -07:00
2010-03-24 16:31:21 -07:00
2010-05-21 18:31:21 -04:00
2010-08-21 08:49:21 -07:00
2007-10-20 01:27:18 +02:00
2010-05-25 08:07:00 -07:00
2010-08-28 13:54:12 -07:00
2010-05-25 15:06:06 +02:00
2009-06-23 12:50:05 -07:00
2010-08-09 20:44:54 -07:00
2010-08-09 20:45:00 -07:00