Linux Operating System Source Code: IBM Patches

 
Use RCU in IPC locking
Description:
This patch makes use of RCU in places where a spinlock is used to protect ipc ID array resizing and ipc_rmid(). By doing so we could breaks the global IPC lock into one lock per ID without adding additional lock. This patch is based on patch, but has been heavily changed. It is in mainline kernel since 2.5.46 kernel.
Developer:
Mingming Cao
Status:
Included in project
Release Included:
2.5.46

Notes:
There were three global locks in IPC, one per type.  To reduce the lock
contention, I have provided a patch which breaks down the global lock into one
lock per ID.  But, we still need a rw lock to protect the IPC ID array resizing.
 We first used a rw lock. But by doing so added another layer of lock and may
cause cacheline bouncing.

RCU core code was got in 2.5.43 kernel, thus provide a way(by using RCU) to
breaks down IPC locks without adding a new layer of rw lock.

Now IPC ID array resizing is lock free.  We also extended the use of RCU in
ipc_rmid() to postpone the real free of a IPC ID until nobody is refering it. 
By doing so is to prevent ipc_lock() returning an invalid IPC ID.

The latest patch could be found in sf.net/projects/lse

This patch is depend on ReadCopyUpdate core patchs(in mainline kernel since
2.5.43), which is also avaliable from sf.net/projects/lse
Release Notes Date Files
linux-2.5.44 Release Notes 2002-11-12  
  File Notes   ipc-rcu-2544.patch.gz
  File Notes   ipc-rcu-2544mm4.patch.gz