linux-stable-rt/arch/um/kernel
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
..
skas
tt
Makefile [PATCH] uml: move tty logging to os-Linux 2006-03-27 08:44:38 -08:00
asm-offsets.c
config.c.in
dyn.lds.S
exec_kern.c [PATCH] uml: move tty logging to os-Linux 2006-03-27 08:44:38 -08:00
exitcode.c
gmon_syms.c
gprof_syms.c
init_task.c
initrd.c
irq.c [PATCH] uml: merge irq_user.c and irq.c 2006-03-27 08:44:37 -08:00
ksyms.c
mem.c [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
physmem.c [PATCH] unify PFN_* macros 2006-03-27 08:44:48 -08:00
process_kern.c
ptrace.c
reboot.c
resource.c
sigio_kern.c [PATCH] uml: move SIGIO startup code to os-Linux/start_up.c 2006-03-27 08:44:38 -08:00
signal_kern.c
smp.c [PATCH] pidhash: don't count idle threads 2006-03-28 18:36:41 -08:00
syscall.c
syscall_kern.c
sysrq.c
time.c
time_kern.c
tlb.c
trap_kern.c
uaccess.c
um_arch.c [PATCH] Notifier chain update: API changes 2006-03-27 08:44:50 -08:00
umid.c
uml.lds.S
vmlinux.lds.S