]> git.ipfire.org Git - thirdparty/linux.git/commit
ipc,namespace: batch free ipc_namespace structures
authorRik van Riel <riel@surriel.com>
Fri, 27 Jan 2023 18:46:51 +0000 (13:46 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 28 Jan 2023 00:08:00 +0000 (19:08 -0500)
commitda27f796a832122ee533c7685438dad1c4e338dd
treef65cbf61db048942e78fc877732d60be814eebb0
parenta80c4adcb574821e534779c48ae13953b7d1d996
ipc,namespace: batch free ipc_namespace structures

Instead of waiting for an RCU grace period between each ipc_namespace
structure that is being freed, wait an RCU grace period for every batch
of ipc_namespace structures.

Thanks to Al Viro for the suggestion of the helper function.

This speeds up the run time of the test case that allocates ipc_namespaces
in a loop from 6 minutes, to a little over 1 second:

real 0m1.192s
user 0m0.038s
sys 0m1.152s

Signed-off-by: Rik van Riel <riel@surriel.com>
Reported-by: Chris Mason <clm@meta.com>
Tested-by: Giuseppe Scrivano <gscrivan@redhat.com>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c
include/linux/mount.h
ipc/mqueue.c
ipc/namespace.c
ipc/util.h