lkml.org 
[lkml]   [2013]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] smp/ipi:Clarify ambiguous comments around deadlock scenarios in smp_call_function variants.
On Sat, 6 Jul 2013, Preeti U Murthy wrote:

> Hi Wang,
>
> On 07/06/2013 11:42 AM, Wang YanQing wrote:
> > On Fri, Jul 05, 2013 at 09:57:11PM +0530, Preeti U Murthy wrote:
> >> Elaborate on when deadlocks can occur when a call is made to
> >> smp_call_function_single() and its friends. This avoids ambiguity about
> >> when to use these calls.
> >>
> >> + * 2. wait = 0: This function could be called from an interrupt
> >> + * context, and can get blocked on the csd_lock(csd) below in
> >> + * "non wait cases".
> >> + * This is because the percpu copy of csd of this_cpu is used
> >> + * in non wait cases. Under such circumstances, if the previous caller
> >> + * of this function who got preempted by this interrupt has already taken
> >> + * the lock under non wait condition, it will result in deadlock.
> >> + *
> >
> > No, it will not cause deadlock, it is not mutex lock, it is busy wait, so
> > when the CSD_FLAG_LOCK be cleared, the code will go on running.
>
> A deadlock might not result, but a potential long wait in an interrupt
> context could result if the source cpu got preempted by an interrupt
> between csd_lock(csd) and generic_exec_single(), where it actually
> sends an ipi to the target cpu.

See https://lkml.org/lkml/2013/7/5/183 and the related thread for real
deadlock scenarios.

Thanks,

tglx


\
 
 \ /
  Last update: 2013-07-06 22:01    [W:0.070 / U:0.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site