Re: Documentation: A 2.4 Kernel Locking HOWTO

From: Rui Sousa (rsousa@grad.physics.sunysb.edu)
Date: Sat Mar 04 2000 - 22:45:10 EST


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/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:17 EST