From: Gaash Hazan <gaash-ppclnx@gaashh•com>
To: linuxppc-dev@ozlabs•org
Cc: gaash-ppclnx@gaashh•com, Gilad Ben-Yossef <gilad@codefidence•com>
Subject: mmu_hash_lock deadlock causes kernel stuck at 2.6.21 SMP powerpc 32bit
Date: Sun, 30 Mar 2008 14:28:25 -0700 (PDT) [thread overview]
Message-ID: <90380.16819.qm@web39603.mail.mud.yahoo.com> (raw)
(reposting)
Hello PPC SMP MM experts,
mmu_hash_lock (arch/powerpc/mm/hash_low_32.S) is a
(non-standard) spin lock that protects the CPU MMU
hashing table. It exists and used only with SMP
configurations.
In some scenarios, the spin lock is taken when
interrupts are *enabled* causing kernel deadlock at
the next take attempt in the same CPU.
The deadlock happened on 2.6.21 kernel, Powerpc 32 bit
with SMP enabled. At this moment system had one active
CPU. The sequence I saw was:
do_exit (program termination)
exit_mm
mmput
exit_mmap
free_pgtables
free_pgd_range
unmap_vmas
pte_free
hash_page_sync (takes mmu_hash_lock. Note: interrupts
are enabled)
timer_interrupt (timer interrupts occurs during
hash_page_sync, lock is taken) irq_exit do_softirq
__do_softirq net_rx_action (packet received from
network) ( ... omitted ... ) xdr_skb_read_bits
skb_copy_bits memcpy - memcpy causes DSI
exception(0x300). This is OK.
DSI exception handler calls hash_page
hash_page waits for mmu_mash_lock. It waits forever
since the lock is already taken.
Deadlock! with interrupts disabled. kernel is dead.
I think the rout cause of the problem is
hash_page_sync() taking the mmu_hash_lock spin lock
without disabling interrupts. This leads to the
deadlock.
To verify the theory, hash_page_sync() was wrapped
with interrupts disabled code and problem never
occurred again. Of course this is temporary workaround
as there are several places needed to be fixed.
What do you think?
Thanks,
Gaash
next reply other threads:[~2008-03-30 21:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-30 21:28 Gaash Hazan [this message]
2008-03-30 21:40 ` mmu_hash_lock deadlock causes kernel stuck at 2.6.21 SMP powerpc 32bit Benjamin Herrenschmidt
2008-03-30 21:49 ` [PATCH] powerpc: Fix deadlock with mmu_hash_lock in hash_page_sync Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2008-03-30 11:47 mmu_hash_lock deadlock causes kernel stuck at 2.6.21 SMP powerpc 32bit Gaash Hazan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=90380.16819.qm@web39603.mail.mud.yahoo.com \
--to=gaash-ppclnx@gaashh$(echo .)com \
--cc=gilad@codefidence$(echo .)com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox