Skip to contentSkip to conversation

+ ipc-document-general-ipc-locking-scheme.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Jul 16, 2013

lore
Share & tools
lore
#0 lore raw

Subject: + ipc-document-general-ipc-locking-scheme.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 16 Jul 2013 15:51:55 -0700

The patch titled
Subject: ipc: document general ipc locking scheme
has been added to the -mm tree. Its filename is
ipc-document-general-ipc-locking-scheme.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/ipc-document-general-ipc-locking-scheme.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/ipc-document-general-ipc-locking-scheme.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Davidlohr Bueso <[email protected]>
Subject: 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.

---

 ipc/util.c |    8 ++++++++
 1 file changed, 8 insertions(+)
ipc/util.c renamed from ipc/util.c~ipc-document-general-ipc-locking-scheme +8 -0
diff -puN ipc/util.c~ipc-document-general-ipc-locking-scheme ipc/util.c
@@ -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>

_

Patches currently in -mm which might be from [email protected] are

linux-next.patch ipcshm-introduce-lockless-functions-to-obtain-the-ipc-object.patch ipcshm-shorten-critical-region-in-shmctl_down.patch ipc-drop-ipcctl_pre_down.patch ipc-drop-ipcctl_pre_down-fix.patch ipcshm-introduce-shmctl_nolock.patch ipcshm-make-shmctl_nolock-lockless.patch ipcshm-shorten-critical-region-for-shmctl.patch ipcshm-cleanup-do_shmat-pasta.patch ipcshm-shorten-critical-region-for-shmat.patch ipc-rename-ids-rw_mutex.patch ipcmsg-drop-msg_unlock.patch ipc-document-general-ipc-locking-scheme.patch