提交 05603c44 编写于 作者: D Davidlohr Bueso 提交者: Linus Torvalds

ipc: document general ipc locking scheme

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: NDavidlohr Bueso <davidlohr.bueso@hp.com>
Tested-by: NSedat Dilek <sedat.dilek@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4718787d
...@@ -15,6 +15,14 @@ ...@@ -15,6 +15,14 @@
* Jun 2006 - namespaces ssupport * Jun 2006 - namespaces ssupport
* OpenVZ, SWsoft Inc. * OpenVZ, SWsoft Inc.
* Pavel Emelianov <xemul@openvz.org> * Pavel Emelianov <xemul@openvz.org>
*
* 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> #include <linux/mm.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册