kernel-ark/arch
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
..
alpha [PATCH] RTC: Remove RTC UIP synchronization on Alpha 2006-03-28 09:16:01 -08:00
arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2006-03-28 13:53:03 -08:00
arm26 [PATCH] unify PFN_* macros 2006-03-27 08:44:48 -08:00
cris [PATCH] unify PFN_* macros 2006-03-27 08:44:48 -08:00
frv [PATCH] bitops: frv: use generic bitops 2006-03-26 08:57:12 -08:00
h8300 [PATCH] bitops: h8300: use generic bitops 2006-03-26 08:57:12 -08:00
i386 Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq 2006-03-28 09:48:32 -08:00
ia64 [PATCH] ia64: const f_ops fix 2006-03-28 09:16:05 -08:00
m32r [PATCH] unify PFN_* macros 2006-03-27 08:44:48 -08:00
m68k [PATCH] RTC: Remove some duplicate BCD definitions 2006-03-28 09:16:01 -08:00
m68knommu [PATCH] bitops: m68knommu: use generic bitops 2006-03-26 08:57:13 -08:00
mips [PATCH] remove add_parent()'s parent argument 2006-03-28 18:36:41 -08:00
parisc [PATCH] Notifier chain update: API changes 2006-03-27 08:44:50 -08:00
powerpc [PATCH] mark f_ops const in the inode 2006-03-28 09:16:05 -08:00
ppc [PATCH] mark f_ops const in the inode 2006-03-28 09:16:05 -08:00
s390 [PATCH] Notifier chain update: API changes 2006-03-27 08:44:50 -08:00
sh [PATCH] RTC: Remove some duplicate BCD definitions 2006-03-28 09:16:01 -08:00
sh64 [PATCH] RTC: Remove some duplicate BCD definitions 2006-03-28 09:16:01 -08:00
sparc [PATCH] bitops: sparc: use generic bitops 2006-03-26 08:57:14 -08:00
sparc64 [PATCH] RTC: Remove RTC UIP synchronization on Sparc64 2006-03-28 09:16:00 -08:00
um [PATCH] pidhash: don't count idle threads 2006-03-28 18:36:41 -08:00
v850 [PATCH] bitops: v850: use generic bitops 2006-03-26 08:57:14 -08:00
x86_64 [PATCH] RTC: Remove RTC UIP synchronization on x86_64 2006-03-28 09:16:00 -08:00
xtensa [PATCH] Notifier chain update: API changes 2006-03-27 08:44:50 -08:00