public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Deadlock in ia64_mca_cmc_int_caller
Date: Sat, 06 Dec 2003 15:23:50 +0000	[thread overview]
Message-ID: <marc-linux-ia64-107072425128279@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-107068420607204@msgid-missing>

Keith,

   We debugged a similar problem with the old CMC/CPE code recently. 
However, the latest version in 2.4/2.6 fixed that problem.  So are you
actually hitting a deadlock when ia64_mca_cmc_int_caller() calls
smp_call_function(ia64_mca_cmc_vector_enable, NULL, 1, 0)?  I've reached
the same conclusion about smp_call_function, my mistake for using it in
the first place, it's way too dangerous.  We need to enable/disable the
CMC vector in a better context or use another mechanism.

	Alex

On Fri, 2003-12-05 at 21:16, Keith Owens wrote:
> 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.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2003-12-06 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-06  4:16 Deadlock in ia64_mca_cmc_int_caller Keith Owens
2003-12-06 15:23 ` Alex Williamson [this message]
2003-12-06 22:50 ` Keith Owens

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=marc-linux-ia64-107072425128279@msgid-missing \
    --to=alex.williamson@hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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