An Efficient Recovery-Based
Spin Lock Protocol for Preemptive Shared-Memory
Multiprocessors
Inappropriate preemption handling in shared-memory
multiprocessors can severely degrade the performance of spin locks.
However, previously proposed prevention-based
preemption handling schemes tend to impose overhead on every lock
acquisition and release whether or not a preemption occurs.
This is because whenever entering an unsafe area
(e.g. a critical section), processes need to notify the
kernel not to preempt them.
This paper proposes a recovery-based spin lock
protocol in which preemptions are allowed
to happen at any time, and when an inopportune preemption
that causes delay occurs, the preempted process is
immediately ``recovered'' from the preemption.
The advantage is that the overhead
is incurred only when the inopportune preemption actually
happens, but not during the normal operation.
Our experimental study shows that
during the normal operation, the recovery-based
spin lock imposes much less overhead than
other prevention-based spin locks,
and under a highly preemptive
environment, its performance degrades, but much more
slowly than that of the spin locks with no preemption handling
facility. Interestingly, the statistical distribution of
response times indicates that
queue-based spin locks with either a prevention-based or
a recovery-based preemption handling scheme are also suitable
for real-time computing as they show a predictable
performance.
PS COPY