Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24550
b: refs/heads/master
c: 73b9ebf
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Mar 29, 2006
1 parent a923d36 commit 7ce93e4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 47 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c97d98931ac52ef110b62d9b75c6a6f2bfbc1898
refs/heads/master: 73b9ebfe126a4a886ee46cbab637374d7024668a
1 change: 0 additions & 1 deletion trunk/arch/um/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ void smp_prepare_cpus(unsigned int maxcpus)
idle = idle_thread(cpu);

init_idle(idle, cpu);
unhash_process(idle);

waittime = 200000000;
while (waittime-- && !cpu_isset(cpu, cpu_callin_map))
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,6 @@ static inline int thread_group_empty(task_t *p)
#define delay_group_leader(p) \
(thread_group_leader(p) && !thread_group_empty(p))

extern void unhash_process(struct task_struct *p);

/*
* Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring
* subscriptions and synchronises with wait4(). Also used in procfs. Also
Expand Down
18 changes: 1 addition & 17 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ static void __unhash_process(struct task_struct *p)
detach_pid(p, PIDTYPE_SID);

list_del_init(&p->tasks);
if (p->pid)
__get_cpu_var(process_counts)--;
__get_cpu_var(process_counts)--;
}

remove_parent(p);
Expand Down Expand Up @@ -118,21 +117,6 @@ void release_task(struct task_struct * p)
goto repeat;
}

/* we are using it only for SMP init */

void unhash_process(struct task_struct *p)
{
struct dentry *proc_dentry;

spin_lock(&p->proc_lock);
proc_dentry = proc_pid_unhash(p);
write_lock_irq(&tasklist_lock);
__unhash_process(p);
write_unlock_irq(&tasklist_lock);
spin_unlock(&p->proc_lock);
proc_pid_flush(proc_dentry);
}

/*
* This checks not only the pgrp, but falls back on the pid if no
* satisfactory pgrp is found. I dunno - gdb doesn't work correctly
Expand Down
35 changes: 18 additions & 17 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,25 +1181,26 @@ static task_t *copy_process(unsigned long clone_flags,
*/
p->ioprio = current->ioprio;

add_parent(p);
if (unlikely(p->ptrace & PT_PTRACED))
__ptrace_link(p, current->parent);

if (thread_group_leader(p)) {
p->signal->tty = current->signal->tty;
p->signal->pgrp = process_group(current);
p->signal->session = current->signal->session;
attach_pid(p, PIDTYPE_PGID, process_group(p));
attach_pid(p, PIDTYPE_SID, p->signal->session);

list_add_tail(&p->tasks, &init_task.tasks);
if (p->pid)
if (likely(p->pid)) {
add_parent(p);
if (unlikely(p->ptrace & PT_PTRACED))
__ptrace_link(p, current->parent);

if (thread_group_leader(p)) {
p->signal->tty = current->signal->tty;
p->signal->pgrp = process_group(current);
p->signal->session = current->signal->session;
attach_pid(p, PIDTYPE_PGID, process_group(p));
attach_pid(p, PIDTYPE_SID, p->signal->session);

list_add_tail(&p->tasks, &init_task.tasks);
__get_cpu_var(process_counts)++;
}
attach_pid(p, PIDTYPE_TGID, p->tgid);
attach_pid(p, PIDTYPE_PID, p->pid);
nr_threads++;
}
attach_pid(p, PIDTYPE_TGID, p->tgid);
attach_pid(p, PIDTYPE_PID, p->pid);

nr_threads++;
total_forks++;
spin_unlock(&current->sighand->siglock);
write_unlock_irq(&tasklist_lock);
Expand Down Expand Up @@ -1263,7 +1264,7 @@ task_t * __devinit fork_idle(int cpu)
if (!task)
return ERR_PTR(-ENOMEM);
init_idle(task, cpu);
unhash_process(task);

return task;
}

Expand Down
10 changes: 1 addition & 9 deletions trunk/kernel/pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,8 @@ void __init pidhash_init(void)

void __init pidmap_init(void)
{
int i;

pidmap_array->page = (void *)get_zeroed_page(GFP_KERNEL);
/* Reserve PID 0. We never call free_pidmap(0) */
set_bit(0, pidmap_array->page);
atomic_dec(&pidmap_array->nr_free);

/*
* Allocate PID 0, and hash it via all PID types:
*/

for (i = 0; i < PIDTYPE_MAX; i++)
attach_pid(current, i, 0);
}

0 comments on commit 7ce93e4

Please sign in to comment.