[PATCH v2] ipc: optimize semget/shmget/msgget for lots of keys

2017-08-15 Thread Guillaume Knispel
0.0 2,250.0 µs 12,510,000.025,700.0 µs 31900 28,200,000.0 115,000.0 µs [1] http://lkml.kernel.org/r/20170814060507.GE23258@yexl-desktop Signed-off-by: Guillaume Knispel Reviewed-by: Marc Pardo --- In v2: - .locks_mul = 1 has been added in ipc_kht_params given

Re: [PATCH] ipc: optimize semget/shmget/msgget for lots of keys

2017-08-09 Thread Guillaume Knispel
On Mon, Aug 07, 2017 at 11:21:03AM -0700, Davidlohr Bueso wrote: > On Mon, 31 Jul 2017, Guillaume Knispel wrote: > > struct ipc_ids { > > int in_use; > > unsigned short seq; > > + bool tables_initialized; > > So this is really ugly to have, but I unders

Re: [PATCH] ipc: optimize semget/shmget/msgget for lots of keys

2017-08-03 Thread Guillaume Knispel
On Wed, Aug 02, 2017 at 01:06:44PM -0700, Davidlohr Bueso wrote: > On Mon, 31 Jul 2017, Guillaume Knispel wrote: > >static int __init ipc_init(void) > >{ > >-sem_init(); > >-msg_init(); > >+int err_sem, err_msg; > >+ > >+err_sem =

Re: [PATCH] ipc: optimize semget/shmget/msgget for lots of keys

2017-07-31 Thread Guillaume Knispel
On Mon, Jul 31, 2017 at 08:45:58AM -0700, Davidlohr Bueso wrote: > On Mon, 31 Jul 2017, Guillaume Knispel wrote: > >ipc_findkey() scanned all objects to look for the wanted key. This is > >slow when using a high number of keys, for example on an i5 laptop the > >following loop

[PATCH] ipc: optimize semget/shmget/msgget for lots of keys

2017-07-31 Thread Guillaume Knispel
.13-rc2, running Ubuntu 16.04.2) [I did not manage to enable CONFIG_PROVE_RCU] Signed-off-by: Guillaume Knispel Reviewed-by: Marc Pardo --- include/linux/ipc.h | 3 ++ include/linux/ipc_namespace.h | 3 ++ ipc/msg.c | 10 +++-- ipc/namespace.c |