diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-17 19:05:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-17 19:24:11 -0700 |
commit | dd34739c03f2f9a79403d33419c2e61e11b4c403 (patch) | |
tree | 74e4e43b78d54994e88aef7df96f0f8f4b080934 /fs/9p | |
parent | eee2acbae95555006307395d8a6c91452d62851d (diff) | |
download | linux-stable-dd34739c03f2f9a79403d33419c2e61e11b4c403.tar.gz linux-stable-dd34739c03f2f9a79403d33419c2e61e11b4c403.tar.bz2 linux-stable-dd34739c03f2f9a79403d33419c2e61e11b4c403.zip |
mm: avoid anon_vma_chain allocation under anon_vma lock
Hugh Dickins points out that lockdep (correctly) spots a potential
deadlock on the anon_vma lock, because we now do a GFP_KERNEL allocation
of anon_vma_chain while doing anon_vma_clone(). The problem is that
page reclaim will want to take the anon_vma lock of any anonymous pages
that it will try to reclaim.
So re-organize the code in anon_vma_clone() slightly: first do just a
GFP_NOWAIT allocation, which will usually work fine. But if that fails,
let's just drop the lock and re-do the allocation, now with GFP_KERNEL.
End result: not only do we avoid the locking problem, this also ends up
getting better concurrency in case the allocation does need to block.
Tim Chen reports that with all these anon_vma locking tweaks, we're now
almost back up to the spinlock performance.
Reported-and-tested-by: Hugh Dickins <hughd@google.com>
Tested-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/9p')
0 files changed, 0 insertions, 0 deletions