Skip to content

Commit

Permalink
ipc: document general ipc locking scheme
Browse files Browse the repository at this point in the history
As suggested by Andrew, add a generic initial locking scheme used
throughout all sysv ipc mechanisms.  Documenting the ids rwsem, how rcu
can be enough to do the initial checks and when to actually acquire the
kern_ipc_perm.lock spinlock.

I found that adding it to util.c was generic enough.

Signed-off-by: Davidlohr Bueso <[email protected]>
Tested-by: Sedat Dilek <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Manfred Spraul <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Davidlohr Bueso authored and torvalds committed Sep 11, 2013
1 parent 4718787 commit 05603c4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
* Jun 2006 - namespaces ssupport
* OpenVZ, SWsoft Inc.
* Pavel Emelianov <[email protected]>
*
* General sysv ipc locking scheme:
* when doing ipc id lookups, take the ids->rwsem
* rcu_read_lock()
* obtain the ipc object (kern_ipc_perm)
* perform security, capabilities, auditing and permission checks, etc.
* acquire the ipc lock (kern_ipc_perm.lock) throught ipc_lock_object()
* perform data updates (ie: SET, RMID, LOCK/UNLOCK commands)
*/

#include <linux/mm.h>
Expand Down

0 comments on commit 05603c4

Please sign in to comment.