public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Deadlock in ia64_mca_cmc_int_caller
@ 2003-12-06  4:16 Keith Owens
  2003-12-06 15:23 ` Alex Williamson
  2003-12-06 22:50 ` Keith Owens
  0 siblings, 2 replies; 3+ messages in thread
From: Keith Owens @ 2003-12-06  4:16 UTC (permalink / raw)
  To: linux-ia64

ia64_mca_cmc_int_caller() calls smp_call_function() which waits until
all cpus have taken the IPI before returning.  This interacts badly
with locks that are sometimes taken with interrupts disabled and
sometimes with interrupts enabled, smp_call_function can deadlock.

cpu 3                                                   cpu 0
Holds tasklist_lock with interrupts enabled,
it did read_lock() or write_lock().

                                                Does read_lock_irq() or
                                                write_lock_irq().  Spinning
                                                disabled waiting for tasklist_lock.

CMC interrupt occurs

ia64_mca_cmc_int_caller() calls smp_call_function()

smp_call_function() sends IPI to other cpus

                                                IPI on cpu 0 blocked, it is disabled
						waiting for tasklist_lock.

smp_call_function() waits until IPI reaches
all other cpus.

cpu 0 never responds, we never release the
tasklist lock, deadlock.

AFAICT it is never safe to call smp_call_function() from an interrupt
handler.

The unsafe nature of smp_call_function is not ia64 specific.  ix86 can
deadlock this way if any ix86 code calls smp_call_function from an
interrupt handler.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-06 22:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-06  4:16 Deadlock in ia64_mca_cmc_int_caller Keith Owens
2003-12-06 15:23 ` Alex Williamson
2003-12-06 22:50 ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox