{
int retval;
- read_lock(&tasklist_lock);
+ read_lock_irq(&tasklist_lock);
retval = will_become_orphaned_pgrp(task_pgrp(current), NULL);
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
return retval;
}
return;
}
- read_lock(&tasklist_lock);
+ read_lock_irq(&tasklist_lock);
/*
* Search in the children
*/
goto assign_new_owner;
} while_each_thread(g, c);
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
/*
* We found no owner yet mm_users > 1: this implies that we are
* most likely racing with swapoff (try_to_unuse()) or /proc or
* Delay read_unlock() till we have the task_lock()
* to ensure that c does not slip away underneath us
*/
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
if (c->mm != mm) {
task_unlock(c);
put_task_struct(c);
struct list_head *dead)
{
list_move_tail(&p->sibling, &p->real_parent->children);
-
- if (p->exit_state == EXIT_DEAD)
- return;
/*
* If this is a threaded reparent there is no need to
* notify anyone anything has happened.
if (same_thread_group(p->real_parent, father))
return;
- /* We don't want people slaying init. */
+ /*
+ * We don't want people slaying init.
+ *
+ * Note: we do this even if it is EXIT_DEAD, wait_task_zombie()
+ * can change ->exit_state to EXIT_ZOMBIE. If this is the final
+ * state, do_notify_parent() was already called and ->exit_signal
+ * doesn't matter.
+ */
p->exit_signal = SIGCHLD;
+ if (p->exit_state == EXIT_DEAD)
+ return;
+
/* If it has exited notify the new parent about this child's death. */
if (!p->ptrace &&
p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) {
exit_shm(tsk);
exit_files(tsk);
exit_fs(tsk);
+ if (group_dead)
+ disassociate_ctty(1);
exit_task_namespaces(tsk);
exit_task_work(tsk);
check_stack_usage();
cgroup_exit(tsk, 1);
- if (group_dead)
- disassociate_ctty(1);
-
module_put(task_thread_info(tsk)->exec_domain->module);
proc_exit_connector(tsk);
-
/*
* FIXME: do that only when needed, using sched_exit tracepoint
*/
int why;
get_task_struct(p);
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
if ((exit_code & 0x7f) == 0) {
why = CLD_EXITED;
status = exit_code >> 8;
* Now we are sure this task is interesting, and no other
* thread can reap it because we set its state to EXIT_DEAD.
*/
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
retval = wo->wo_rusage
? getrusage(p, RUSAGE_BOTH, wo->wo_rusage) : 0;
get_task_struct(p);
pid = task_pid_vnr(p);
why = ptrace ? CLD_TRAPPED : CLD_STOPPED;
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
if (unlikely(wo->wo_flags & WNOWAIT))
return wait_noreap_copyout(wo, p, pid, uid, why, exit_code);
pid = task_pid_vnr(p);
get_task_struct(p);
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
if (!wo->wo_info) {
retval = wo->wo_rusage
goto notask;
set_current_state(TASK_INTERRUPTIBLE);
- read_lock(&tasklist_lock);
+ read_lock_irq(&tasklist_lock);
tsk = current;
do {
retval = do_wait_thread(wo, tsk);
if (wo->wo_flags & __WNOTHREAD)
break;
} while_each_thread(current, tsk);
- read_unlock(&tasklist_lock);
+ read_unlock_irq(&tasklist_lock);
notask:
retval = wo->notask_error;