WSL2-Linux-Kernel/arch/um
Oleg Nesterov 73b9ebfe12 [PATCH] pidhash: don't count idle threads
fork_idle() does unhash_process() just after copy_process().  Contrary,
boot_cpu's idle thread explicitely registers itself for each pid_type with nr
= 0.

copy_process() already checks p->pid != 0 before process_counts++, I think we
can just skip attach_pid() calls and job control inits for idle threads and
kill unhash_process().  We don't need to cleanup ->proc_dentry in fork_idle()
because with this patch idle threads are never hashed in
kernel/pid.c:pid_hash[].

We don't need to hash pid == 0 in pidmap_init().  free_pidmap() is never
called with pid == 0 arg, so it will never be reused.  So it is still possible
to use pid == 0 in any PIDTYPE_xxx namespace from kernel/pid.c's POV.

However with this patch we don't hash pid == 0 for PIDTYPE_PID case.  We still
have have PIDTYPE_PGID/PIDTYPE_SID entries with pid == 0: /sbin/init and
kernel threads which don't call daemonize().

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-28 18:36:41 -08:00
..
drivers [PATCH] Notifier chain update: API changes 2006-03-27 08:44:50 -08:00
include [PATCH] uml: oS header cleanups 2006-03-27 08:44:38 -08:00
kernel [PATCH] pidhash: don't count idle threads 2006-03-28 18:36:41 -08:00
os-Linux [PATCH] uml: fix thread startup race 2006-03-27 08:44:38 -08:00
scripts [PATCH] uml: arch/um/scripts/Makefile.rules - remove duplicated code 2005-12-18 11:19:44 -08:00
sys-i386 [PATCH] uml: fix segfault on signal delivery 2006-03-27 08:44:38 -08:00
sys-ia64
sys-ppc
sys-x86_64 [PATCH] uml: fix segfault on signal delivery 2006-03-27 08:44:38 -08:00
Kconfig [PATCH] uml: arch Kconfig menu cleanups 2006-01-18 19:20:21 -08:00
Kconfig.char
Kconfig.debug [PATCH] uml: workaround GDB problems on debugging 2005-09-05 00:06:20 -07:00
Kconfig.i386 [PATCH] um: fix undefined reference to hweight32 2006-03-26 08:57:09 -08:00
Kconfig.net
Kconfig.scsi
Kconfig.x86_64 [PATCH] um: fix undefined reference to hweight32 2006-03-26 08:57:09 -08:00
Makefile kbuild: change kbuild to not rely on incorrect GNU make behavior 2006-03-06 00:09:51 +01:00
Makefile-i386 [PATCH] uml: fixups for "reuse i386 cpu-specific tuning" 2005-11-13 18:14:14 -08:00
Makefile-ia64
Makefile-os-Linux
Makefile-ppc
Makefile-skas [PATCH] uml makefiles sanitized 2005-09-29 08:46:26 -07:00
Makefile-tt
Makefile-x86_64 [PATCH] uml: fix dynamic linking on some 64-bit distros 2005-12-18 11:19:44 -08:00
config.release
defconfig