Spinlocks

brankok_at_dkts.co.yu
Date: 10/18/05


Date: 18 Oct 2005 00:13:30 -0700

Hello!

I would be most grateful for an explanation.

I am writing a device driver for a device in which data transfer is
interrupt-driven in a way that the device interrupts the processor when
new data has arrived. I have some shared data that I want to protect
from concurrent access, so I decided to use spinlock mechanism. I've
read about functions that work with spinlocks and I decided to use
_irqsave versions of the premitives both in the interrupt and in the
noninterrupt code. Now I'm wondering if I should have used spinlocks at
all. Couldn't I have just disable interrupts in in the noninterrupt
code, do the critical section and then enable interrupts? What am I not
getting?
 
Thanks in advance



Relevant Pages

  • Re: Spinlocks
    ... > I am writing a device driver for a device in which data transfer is ... > noninterrupt code. ... Now I'm wondering if I should have used spinlocks at ... Couldn't I have just disable interrupts in in the noninterrupt ...
    (comp.os.linux.development.system)
  • Re: [RFC] Add support for semaphore-like structure with support for asynchronous I/O
    ... > implemented your mutex you appear to have to take spinlocks and disable ... > interrupts a lot more than is necessary. ... > On FRV disabling interrupts is quite expensive, so I've made my own simple ... > semaphores that don't need to take spinlocks and disable interrupts in the ...
    (Linux-Kernel)
  • Re: amd64 cpu_switch in C.
    ... the cycles have interrupts masked. ... time is being spent near cpu_switchwith a spinlock held. ... I'm not sure why you feel masking interrupts in spinlocks is bogus. ...
    (freebsd-arch)
  • Re: Question from Russells Spinlocks
    ... > I was reading Russell's guide on spinlocks, ... > like disable interrupts and premptations. ... > understanding is that since they aren't used anywhere outside kernel and ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)