linux/init
Eric W. Biederman 73c279927f kthread: don't depend on work queues
Currently there is a circular reference between work queue initialization
and kthread initialization.  This prevents the kthread infrastructure from
initializing until after work queues have been initialized.

We want the properties of tasks created with kthread_create to be as close
as possible to the init_task and to not be contaminated by user processes.
The later we start our kthreadd that creates these tasks the harder it is
to avoid contamination from user processes and the more of a mess we have
to clean up because the defaults have changed on us.

So this patch modifies the kthread support to not use work queues but to
instead use a simple list of structures, and to have kthreadd start from
init_task immediately after our kernel thread that execs /sbin/init.

By being a true child of init_task we only have to change those process
settings that we want to have different from init_task, such as our process
name, the cpus that are allowed, blocking all signals and setting SIGCHLD
to SIG_IGN so that all of our children are reaped automatically.

By being a true child of init_task we also naturally get our ppid set to 0
and do not wind up as a child of PID == 1.  Ensuring that tasks generated
by kthread_create will not slow down the functioning of the wait family of
functions.

[akpm@linux-foundation.org: use interruptible sleeps]
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-09 12:30:53 -07:00
..
calibrate.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
do_mounts_initrd.c freezer: remove PF_NOFREEZE from handle_initrd 2007-05-07 12:12:59 -07:00
do_mounts_md.c [PATCH] md: remove MAX_MD_DEVS which is an arbitrary limit 2006-10-03 08:04:18 -07:00
do_mounts_rd.c [PATCH] devfs: Remove devfs from the init code 2006-06-26 12:25:05 -07:00
do_mounts.c Display all possible partitions when the root filesystem failed to mount 2007-05-09 12:30:48 -07:00
do_mounts.h Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
initramfs.c [PATCH] Add retain_initrd boot option 2007-02-11 10:51:24 -08:00
Kconfig Fix spellings of slab allocator section in init/Kconfig 2007-05-09 12:30:46 -07:00
main.c kthread: don't depend on work queues 2007-05-09 12:30:53 -07:00
Makefile [PATCH] disable init/initramfs.c 2007-02-11 10:51:25 -08:00
noinitramfs.c [PATCH] disable init/initramfs.c 2007-02-11 10:51:25 -08:00
version.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00