Messages in this thread | | | Date | Sat, 04 Mar 2000 22:45:10 -0500 | From | Rui Sousa <> | Subject | Re: 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/
| |