• Aneesh Kumar K.V's avatar
    powerpc: Fix possible deadlock on page fault · 69e044dd
    Aneesh Kumar K.V authored
     stack_grow_into/14082 is trying to acquire lock:
      (&mm->mmap_sem){++++++}, at: [<c000000000206d28>] .might_fault+0x78/0xe0
    
     but task is already holding lock:
      (&mm->mmap_sem){++++++}, at: [<c0000000007ffd8c>] .do_page_fault+0x24c/0x910
    
     other info that might help us debug this:
      Possible unsafe locking scenario:
    
            CPU0
            ----
       lock(&mm->mmap_sem);
       lock(&mm->mmap_sem);
    
      *** DEADLOCK ***
    
      May be due to missing lock nesting notation
    
     1 lock held by stack_grow_into/14082:
      #0:  (&mm->mmap_sem){++++++}, at: [<c0000000007ffd8c>] .do_page_fault+0x24c/0x910
    
     stack backtrace:
     CPU: 21 PID: 14082 Comm: stack_grow_into Not tainted 3.10.0-10.el7.ppc64.debug #1
     Call Trace:
     [c0000003d396b850] [c000000000016e7c] .show_stack+0x7c/0x1f0 (unreliable)
     [c0000003d396b920] [c000000000813fc8] .dump_stack+0x28/0x3c
     [c0000003d396b990] [c000000000124b90] .__lock_acquire+0x1640/0x1800
     [c0000003d396bab0] [c00000000012570c] .lock_acquire+0xac/0x250
     [c0000003d396bb80] [c000000000206d54] .might_fault+0xa4/0xe0
     [c0000003d396bbf0] [c0000000007ffe2c] .do_page_fault+0x2ec/0x910
     [c0000003d396be30] [c0000000000092e8] handle_page_fault+0x10/0x30
    Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    69e044dd
fault.c 14.8 KB