<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/s390/include/asm/pgalloc.h, branch v2.6.32</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[S390] fix recursive locking on page_table_lock</title>
<updated>2009-09-11T08:29:53+00:00</updated>
<author>
<name>Martin Schwidefsky</name>
<email>schwidefsky@de.ibm.com</email>
</author>
<published>2009-09-11T08:28:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=50aa98bad056a17655864a4d71ebc32d95c629a7'/>
<id>50aa98bad056a17655864a4d71ebc32d95c629a7</id>
<content type='text'>
Suzuki Poulose reported the following recursive locking bug on s390:

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

  [&lt;0000000000406ed6&gt;] _spin_lock+0x52/0x94
  [&lt;0000000000103bde&gt;] crst_table_free+0x14e/0x1a4
  [&lt;00000000001ba684&gt;] __pmd_alloc+0x114/0x1ec
  [&lt;00000000001be8d0&gt;] handle_mm_fault+0x2cc/0xb80
  [&lt;0000000000407d62&gt;] do_dat_exception+0x2b6/0x3a0
  [&lt;0000000000114f8c&gt;] sysc_return+0x0/0x8
  [&lt;00000200001642b2&gt;] 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 &lt;suzuki@in.ibm.com&gt;
Cc: Dave Hansen &lt;dave@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Suzuki Poulose reported the following recursive locking bug on s390:

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

  [&lt;0000000000406ed6&gt;] _spin_lock+0x52/0x94
  [&lt;0000000000103bde&gt;] crst_table_free+0x14e/0x1a4
  [&lt;00000000001ba684&gt;] __pmd_alloc+0x114/0x1ec
  [&lt;00000000001be8d0&gt;] handle_mm_fault+0x2cc/0xb80
  [&lt;0000000000407d62&gt;] do_dat_exception+0x2b6/0x3a0
  [&lt;0000000000114f8c&gt;] sysc_return+0x0/0x8
  [&lt;00000200001642b2&gt;] 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 &lt;suzuki@in.ibm.com&gt;
Cc: Dave Hansen &lt;dave@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[S390] clear_table inline assembly contraints</title>
<updated>2008-12-25T12:39:15+00:00</updated>
<author>
<name>Martin Schwidefsky</name>
<email>schwidefsky@de.ibm.com</email>
</author>
<published>2008-12-25T12:39:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4f7e90d6d61fa0e56821787521c12f8a626c4037'/>
<id>4f7e90d6d61fa0e56821787521c12f8a626c4037</id>
<content type='text'>
Tell the compile that the clear_table inline assembly writes to the
memory referenced by *s.

Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tell the compile that the clear_table inline assembly writes to the
memory referenced by *s.

Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[S390] move include/asm-s390 to arch/s390/include/asm</title>
<updated>2008-08-01T18:42:05+00:00</updated>
<author>
<name>Martin Schwidefsky</name>
<email>schwidefsky@de.ibm.com</email>
</author>
<published>2008-08-01T18:42:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c6557e7f2b6ae76a44653d38f835174074c42e05'/>
<id>c6557e7f2b6ae76a44653d38f835174074c42e05</id>
<content type='text'>
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
