History

ipc/namespace.c: use a work queue to free_ipc

the reason is to avoid a delay caused by the synchronize_rcu() call in kern_umount() when the mqueue mount is freed. the code: #define _GNU_SOURCE #include <sched.h> #include <error.h> #include <errno.h> #include <stdlib.h> int main() { int i; for (i = 0; i < 1000; i++) if (unshare(CLONE_NEWIPC) < 0) error(EXIT_FAILURE, errno, "unshare"); } goes from Command being timed: "./ipc-namespace" User time (seconds): 0.00 System time (seconds): 0.06 Percent of CPU this job got: 0% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.05 to Command being timed: "./ipc-namespace" User time (seconds): 0.00 System time (seconds): 0.02 Percent of CPU this job got: 96% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.03

Giuseppe Scrivano committed 6 years ago

Commit e1eb26f1 parent 4b78e202 files · +24 −2Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/ipc_namespace.h+2−0
@@ -68,6 +68,8 @@ struct ipc_namespace { · 67 unmodified lines
68 struct user_namespace *user_ns;68 struct user_namespace *user_ns;
69 struct ucounts *ucounts;69 struct ucounts *ucounts;
70 70
71 struct llist_node mnt_llist;
72
71 struct ns_common ns;73 struct ns_common ns;
72} __randomize_layout;74} __randomize_layout;
73 75