diff options
author | Hugh Dickins <hughd@google.com> | 2011-05-28 22:20:21 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-29 01:55:32 +0200 |
commit | eee0f252c6537da2e883f75d22cff1427515eaf3 (patch) | |
tree | 87ca6a49dd2d299b6cb4146ff3295bb625519b05 /drivers/scsi/scsi_proc.c | |
parent | mm: fix kernel BUG at mm/rmap.c:1017! (diff) | |
download | linux-eee0f252c6537da2e883f75d22cff1427515eaf3.tar.xz linux-eee0f252c6537da2e883f75d22cff1427515eaf3.zip |
mm: fix page_lock_anon_vma leaving mutex locked
On one machine I've been getting hangs, a page fault's anon_vma_prepare()
waiting in anon_vma_lock(), other processes waiting for that page's lock.
This is a replay of last year's f18194275c39 "mm: fix hang on
anon_vma->root->lock".
The new page_lock_anon_vma() places too much faith in its refcount: when
it has acquired the mutex_trylock(), it's possible that a racing task in
anon_vma_alloc() has just reallocated the struct anon_vma, set refcount
to 1, and is about to reset its anon_vma->root.
Fix this by saving anon_vma->root, and relying on the usual page_mapped()
check instead of a refcount check: if page is still mapped, the anon_vma
is still ours; if page is not still mapped, we're no longer interested.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi/scsi_proc.c')
0 files changed, 0 insertions, 0 deletions