spin_lock doesn't work?!?

Wolfgang Reissnegger wolfgang.reissnegger at xilinx.com
Thu Aug 30 07:40:50 EST 2007


Hi Melinda,

depending on how your kernel is configured spin_locks will compileinto
nothing. For example, if you are compiling a kernel for a single
processor platform without preemptive scheduling then the spin_lock()
calls will be compiled into no-op as they are unnecessary on a non-SMP,
non-preemptive system.

You should still put the spin_lock calls into your code because you
never know if someone else will compile it and for another target. If
someone would, for example, compile the same code for a SMP machine then
the spin_lock will actually lock.

Cheers,
   Wolfgang

melinda develey wrote:
> I discovered that I called spin_lock two times consecutively without
> calling spin_unlock but my code didn't lock (I was managing an ioctl).
> Probably I didn't understand how spin_lock works!!!!
> 
> Any help?
> 
> ------------------------------------------------------------------------
> Need a vacation? Get great deals to amazing places
> <http://us.rd.yahoo.com/evt=48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ-->on
> Yahoo! Travel.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded



More information about the Linuxppc-embedded mailing list