Check out the new USENIX Web site. next up previous
Next: Semaphore Data Structures Up: Using Read-Copy-Update Techniques for Previous: RCU Implementation

RCU Implementation of System V IPC

This section describes how the reader-writer-lock/RCU analogy described in Section 2.5 was used to break up the global locks used by Linux's System V IPC primitives. These locks guard the following: (1) mapping from IPC identifiers to corresponding kern_ipc_perm structures, (2) expanding the mapping arrays, and (3) individual IPC operations. A straightforward modification would replace these global locks with reader-writer locks, allowing mapping operations to be performed in parallel.

However, we took the additional step of following the analogy, replacing the global locks with RCU [Cao02] to guard the mapping arrays and per-kern_ipc_perm locks to guard the IPC operations, which resulted in significant system-level speedups on database benchmarks. This modification also serves to illustrate use of explicit memory barriers and use of a deleted flag to prevent access to stale data.

The remainder of this section focuses on the changes to the System V semaphores; analogous changes were made to message queues and shared memory.


Paul McKenney 2003-03-28