lkml.org 
[lkml]   [2001]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [Linux-IrDA]Re: [IrDA+SMP] Lockup in handle_IRQ_event

> BTW: What i have seen in the ircomm_tty.c (2.2.18):
>
> 647 save_flags(flags);
> 648 cli();
> 649
> 650 skb = self->tx_skb;
> 651 self->tx_skb = NULL;
> 652
> 653 restore_flags(flags);
>
> and a lot of other places simply use "save_flags(flags); cli();
> restore_flags()". Can someone enlighten me how this is supposed to work
> on SMP machines ? AFAIK "cli()" only disables IRQs on the local
> CPU so a different CPU could easily stumple half way as this
> is definitly non atomic. Or is the tty layer protected by some
> "big tty lock" ?

On SMP __cli() disables interrupts on the local cpu, cli() also grabs
the global irq lock which serialises irqs between cpus.

Using a spinlock is much preferred if possible as grabbing the global
irq lock is expensive (and in most cases unnecessary).

Anton
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [from the cache]
©2003-2011 Jasper Spaans