Re: Spinlocks under uniprocessor running non preemptible kernel
- From: Rainer Weikusat <rweikusat@xxxxxxxxxxx>
- Date: Fri, 21 Sep 2007 15:10:11 +0200
Josef Moellers <josef.moellers@xxxxxxxxxxxxxxxxxxx> writes:
MAx wrote:
Does that mean spinlocks do not do the job they are meant to do on a
uniprocessor system with
linux 2.4.x(non-preemptible kernel)
On a uniprocessor, either a spinlock() call will succeed immediately
or hang infinitely.
It can only 'hang indefinitely' if an attempt to lock a locked
spinlock which can never be preempted by the lock holder can occur.
For a non-preempable MP kernel running on an uniprocessor, there is
exactly one situation when this could occur:
a) a spin lock is used for synchronization among code running
at different 'interrupt levels' (hard irq, soft irq, process
context)
b) the 'higher-level' code does not disable execution of the
'lower level' code before trying to lock the spin lock.
An example would be an interrupt handler interrupting code running in
process context which acquired a spin lock but didn't disable
interrupts. The interrupt handler code will then just spin forever.
But the same issue can happen on a multiprocessor if this interrupt
handler would interrupt a process holding ... running on the same
CPU, meaning this would be a programming error.
.
- References:
- Spinlocks under uniprocessor running non preemptible kernel
- From: MAx
- Re: Spinlocks under uniprocessor running non preemptible kernel
- From: Rainer Weikusat
- Re: Spinlocks under uniprocessor running non preemptible kernel
- From: MAx
- Re: Spinlocks under uniprocessor running non preemptible kernel
- From: Josef Moellers
- Spinlocks under uniprocessor running non preemptible kernel
- Prev by Date: Re: Spinlocks under uniprocessor running non preemptible kernel
- Next by Date: ::::::corebld : applet not found::::::
- Previous by thread: Re: Spinlocks under uniprocessor running non preemptible kernel
- Next by thread: Re: Spinlocks under uniprocessor running non preemptible kernel
- Index(es):
Relevant Pages
|