powerpc: Fix deadlock in icswx code
commiteaeafcd898108e4e026faf43ca41817f5de6ee66
authorAnton Blanchard <anton@samba.org>
Wed, 14 Sep 2011 09:43:15 +0000 (14 09:43 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:37:11 +0000 (11 09:37 -0800)
tree363bec39cbe790f0aa86c657214753ad4808e270
parent71b1a9d35d6cbd2e37c1101ca5f779ca55f7fb03
powerpc: Fix deadlock in icswx code

commit 8bdafa39a47265bc029838b35cc6585f69224afa upstream.

The icswx code introduced an A-B B-A deadlock:

     CPU0                    CPU1
     ----                    ----
lock(&anon_vma->mutex);
                             lock(&mm->mmap_sem);
                             lock(&anon_vma->mutex);
lock(&mm->mmap_sem);

Instead of using the mmap_sem to keep mm_users constant, take the
page table spinlock.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/mm/mmu_context_hash64.c