diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-03-28 19:11:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 21:36:41 -0500 |
commit | 73b9ebfe126a4a886ee46cbab637374d7024668a (patch) | |
tree | d7ba00d4ce76b49c1569334956cd196b35977a04 /arch/um/kernel/smp.c | |
parent | c97d98931ac52ef110b62d9b75c6a6f2bfbc1898 (diff) |
[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>
Diffstat (limited to 'arch/um/kernel/smp.c')
-rw-r--r-- | arch/um/kernel/smp.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c index c8d8d0ac1a7f..511116aebaf7 100644 --- a/arch/um/kernel/smp.c +++ b/arch/um/kernel/smp.c | |||
@@ -143,7 +143,6 @@ void smp_prepare_cpus(unsigned int maxcpus) | |||
143 | idle = idle_thread(cpu); | 143 | idle = idle_thread(cpu); |
144 | 144 | ||
145 | init_idle(idle, cpu); | 145 | init_idle(idle, cpu); |
146 | unhash_process(idle); | ||
147 | 146 | ||
148 | waittime = 200000000; | 147 | waittime = 200000000; |
149 | while (waittime-- && !cpu_isset(cpu, cpu_callin_map)) | 148 | while (waittime-- && !cpu_isset(cpu, cpu_callin_map)) |