Skip to content

Commit

Permalink
Do 'shm_init_ns()' in an early pure_initcall
Browse files Browse the repository at this point in the history
This isn't really critical any more, since other patches (commit
298507d: "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 288d5ab ("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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Aug 5, 2011
1 parent 24f0eed commit 140d0b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 140d0b2

Please sign in to comment.