]>
git.kernelconcepts.de Git - karo-tx-linux.git/commit
nsproxy: move free_nsproxy() out of do_exit() path
free_nsproxy() is too heavy to be on the exit path. Let's free namespaces
asynchronously to not block exit_group() syscall.
Microbenchmark:
: #define _GNU_SOURCE
: #include <unistd.h>
: #include <sched.h>
: #include <stdlib.h>
: #include <sys/wait.h>
:
: int
: main(void)
: {
: int i;
: for (i = 0; i < 1024; i++) {
: if (fork()) {
: wait(NULL);
: continue;
: }
: unshare(CLONE_NEWIPC);
: exit(0);
: }
: return 0;
: }
Before the patch:
real 0m8.335s
user 0m0.000s
sys 0m0.265s
After:
real 0m0.569s
user 0m0.001s
sys 0m0.154s
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Doug Ledford <dledford@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>