From d089df7c2dd167b0f1c110b5c2367cd7fe26dacc Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 4 Aug 2011 19:35:59 -1000 Subject: [PATCH] Do 'shm_init_ns()' in an early pure_initcall This isn't really critical any more, since other patches (commit 3267cc5fb6f7: "shm: optimize exit_shm()") have caused us to not actually need to touch the rw_mutex unless there are actual shm segments associated with the namespace, but we really should do tne shm_init_ns() earlier than we do now. This, together with commit e41c8904ac91 ("Boot up with usermodehelper disabled") will mean that we really do initialize the initial ipc namespace data structure before we run any tasks. Tested-by: Marc Zyngier Signed-off-by: Linus Torvalds --- ipc/shm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ipc/shm.c b/ipc/shm.c index b5bae9d945b62..02ecf2c078fce 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -105,9 +105,16 @@ void shm_exit_ns(struct ipc_namespace *ns) } #endif -void __init shm_init (void) +static int __init ipc_ns_init(void) { shm_init_ns(&init_ipc_ns); + return 0; +} + +pure_initcall(ipc_ns_init); + +void __init shm_init (void) +{ ipc_init_proc_interface("sysvipc/shm", #if BITS_PER_LONG <= 32 " key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime rss swap\n", -- 2.39.5