lkml.org 
[lkml]   [2000]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Documentation: A 2.4 Kernel Locking HOWTO
Rusty Russell wrote:
>
> With apologies to those who learnt all this stuff the hard way.
>
> http://netfilter.kernelnotes.org/unreliable-guides
>
> Feedback welcome, and thanks to those who already have,

From what I read it would seem that the only reason to
use spin_lock_irqsave()/spin_lock_irqrestore() is when you don't know
if the piece of code is going to be called from an irq handler or
a sofirq, but doesn't the following piece of code lead to a race condition?
Or at (a) only the lock is released and local irq's still remain disabled?

softirq(){
...
spin_lock_irq(&lock1);
...
spin_lock_irq(&lock2);
...
spin_unlock_irq(&lock2); <--- (a) enable local irq's?
...
spin_unlock_irq(&lock1);
...
return;
}


Rui Sousa

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

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.637 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site