lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 4/5] metag: kick: prevent nested kick handlers
From
On 1 July 2013 22:51, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Mon, 1 Jul 2013, James Hogan wrote:
>
>> The main kick trigger handler iterates a list of kick handlers and calls
>> each one. This is done with the kick_handlers_lock spin lock held, but
>> this causes a problem on SMP where IPIs are implemented with kicks. A
>> reschedule IPI calls scheduler_ipi() which uses irq_enter() and
>> irq_exit(). This results in the scheduler being invoked with
>> kick_handlers_lock held which can result in a nested kick trigger
>> attempting to acquire the lock, resulting in deadlock.
>>
>> irq_enter() and irq_exit() can nest, so call them from the main kick
>> interrupt handler so that softirqs are only handled after
>> kick_handlers_lock is released.
>
> This changelog is confusing. What I decode from the patch is, that you
> are adding a missing irq_enter/exit pair to the kick_handler, right ?

Yes. Previously the outermost pair of irq_enter/exit was inside the
spin lock critical section (inside scheduler_ipi). so soft-irqs
(apparently including the scheduler) would run from irq_exit with the
spinlock still held. Now it waits until the new outermost irq_exit(),
after the spin lock is released.

I should probably have increased the number of lines of diff context.
http://lxr.linux.no/#linux+v3.10/arch/metag/kernel/kick.c#L66

Cheers
James


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