All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] sysv mqueue: do not hold the ipc lock unnecessarily
@ 2013-05-16  1:07 Davidlohr Bueso
  2013-05-16  1:08 ` [PATCH 01/11] ipc: move rcu lock out of ipc_addid Davidlohr Bueso
                   ` (12 more replies)
  0 siblings, 13 replies; 19+ messages in thread
From: Davidlohr Bueso @ 2013-05-16  1:07 UTC (permalink / raw)
  To: akpm; +Cc: torvalds, riel, linux-kernel, Davidlohr Bueso

This patchset continues the work that began in the sysv ipc semaphore scaling 
series: https://lkml.org/lkml/2013/3/20/546

Just like semaphores used to be, sysv shared memory and msg queues also abuse the ipc
lock, unnecessarily holding it for operations such as permission and security checks. This
patchset mostly deals with mqueues, and while shared mem can be done in a very similar way,
I want to get these patches out in the open first. It also does some pending cleanups,
mostly focused on the two level locking we have in ipc code, taking care of ipc_addid() 
and ipcctl_pre_down_nolock() - yes there are still functions that need to be updated as well.

I have tried to split each patch to be as readable and specific as possible, specially when
shortening the critical regions, going one function at a time.

Patch 1 moves the locking to be explicitly done by the callers of ipc_addid.
It updates msg, sem and shm.

Patches 2-3: are just wrappers around the ipc lock, initially suggested by Linus.

Patch 4 is similar to patch 1, moving the rcu and rw_mutex locking out of
ipcctl_pre_down_nolock so that the callers explicitly deals with them. It updates msg, sem
and shm.

Patch 5 shortens the critical region in msgctl_down(), using the lockless
ipcctl_pre_down() function and only acquiring the ipc lock for RMID and SET commands.

Patch 6 simply moves the what-should-be lockless logic of *_INFO and *_STAT commands
out of msgctl() into a new function, msgctl_lockless().

Patch 7 introduces the necessary wrappers around ipc_obtain_object[_check]()
that will later enable us to separately lookup the ipc object without holding the lock.

Patch 8 updates the previously added msgctl_nolock() to actually be lockless, reducing
the critical region for the STAT commands.

Patch 9 redoes the locking for msgsend().

Patch 10 redoes the locking for msgrcv().

Patch 11 removes the now unused msg_lock and msg_lock_check functions, replaced by
a smarter combination of rcu, ipc_obtain_object and ipc_object_lock.

Davidlohr Bueso (11):
  ipc: move rcu lock out of ipc_addid
  ipc: introduce ipc object locking helpers
  ipc: close open coded spin lock calls
  ipc: move locking out of ipcctl_pre_down_nolock
  ipc,msg: shorten critical region in semctl_down
  ipc,msg: introduce msgctl_nolock
  ipc,msg: introduce lockless functions to obtain the ipc object
  ipc,msg: make msgctl_nolock lockless
  ipc,msg: reduce critical region in msgsnd
  ipc,msg: make shorten critical region in msgrcv
  ipc: remove unused functions

 ipc/msg.c  | 227 ++++++++++++++++++++++++++++++++++++++-----------------------
 ipc/sem.c  |  42 +++++++-----
 ipc/shm.c  |  32 ++++++---
 ipc/util.c |  25 ++-----
 ipc/util.h |  22 ++++--
 5 files changed, 211 insertions(+), 137 deletions(-)

Thanks,
Davidlohr

-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-05-24 22:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-16  1:07 [PATCH 00/11] sysv mqueue: do not hold the ipc lock unnecessarily Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 01/11] ipc: move rcu lock out of ipc_addid Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 02/11] ipc: introduce ipc object locking helpers Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 03/11] ipc: close open coded spin lock calls Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 04/11] ipc: move locking out of ipcctl_pre_down_nolock Davidlohr Bueso
2013-05-16 17:55   ` Andi Kleen
2013-05-24 20:16   ` Andrew Morton
2013-05-24 22:21     ` Davidlohr Bueso
2013-05-24 22:29       ` Andrew Morton
2013-05-16  1:08 ` [PATCH 05/11] ipc,msg: shorten critical region in msgctl_down Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 06/11] ipc,msg: introduce msgctl_nolock Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 07/11] ipc,msg: introduce lockless functions to obtain the ipc object Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 08/11] ipc,msg: make msgctl_nolock lockless Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 09/11] ipc,msg: shorten critical region in msgsnd Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 10/11] ipc,msg: shorten critical region in msgrcv Davidlohr Bueso
2013-05-16  1:08 ` [PATCH 11/11] ipc: remove unused functions Davidlohr Bueso
2013-05-16 14:12 ` [PATCH 00/11] sysv mqueue: do not hold the ipc lock unnecessarily Linus Torvalds
2013-05-16 16:41   ` Davidlohr Bueso
2013-05-24  1:45 ` Davidlohr Bueso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.