linux/arch/s390/mm
Martin Schwidefsky 50aa98bad0 [S390] fix recursive locking on page_table_lock
Suzuki Poulose reported the following recursive locking bug on s390:

Here is the stack trace : (see Appendix I for more info)

  [<0000000000406ed6>] _spin_lock+0x52/0x94
  [<0000000000103bde>] crst_table_free+0x14e/0x1a4
  [<00000000001ba684>] __pmd_alloc+0x114/0x1ec
  [<00000000001be8d0>] handle_mm_fault+0x2cc/0xb80
  [<0000000000407d62>] do_dat_exception+0x2b6/0x3a0
  [<0000000000114f8c>] sysc_return+0x0/0x8
  [<00000200001642b2>] 0x200001642b2

The page_table_lock is already acquired in __pmd_alloc (mm/memory.c) and
it tries to populate the pud/pgd with a new pmd allocated. If another
thread populates it before we get a chance, we free the pmd using
pmd_free().

On s390x, pmd_free(even pud_free ) is #defined to crst_table_free(),
which acquires the page_table_lock to protect the crst_table index updates.

Hence this ends up in a recursive locking of the page_table_lock.

The solution suggested by Dave Hansen is to use a new spin lock in the mmu
context to protect the access to the crst_list and the pgtable_list.

Reported-by: Suzuki Poulose <suzuki@in.ibm.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11 10:29:53 +02:00
..
cmm.c [S390] cmm: remove unused binary sysctls. 2007-11-20 11:13:45 +01:00
extmem.c [S390] convert dcssblk and extmem printks messages to pr_xxx macros. 2008-12-25 13:39:23 +01:00
fault.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
hugetlbpage.c hugetlb: introduce pud_huge 2008-07-24 10:47:18 -07:00
init.c [S390] move EXPORT_SYMBOLs to definitions 2009-03-26 15:24:11 +01:00
maccess.c [S390] maccess: arch specific probe_kernel_write() implementation 2009-06-12 10:27:37 +02:00
Makefile [S390] maccess: arch specific probe_kernel_write() implementation 2009-06-12 10:27:37 +02:00
mmap.c [S390] implement is_compat_task 2009-06-12 10:27:30 +02:00
page-states.c [S390] guest page hinting light 2008-05-07 09:23:02 +02:00
pgtable.c [S390] fix recursive locking on page_table_lock 2009-09-11 10:29:53 +02:00
vmem.c [S390] fix recursive locking on page_table_lock 2009-09-11 10:29:53 +02:00