diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2012-07-20 16:42:59 +0900 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2012-07-20 16:42:59 +0900 |
| commit | 9ff561fdf73493d757bbc74aa58627e1381650fb (patch) | |
| tree | 4484d230662126b1ac94ea545ca5429c91e0a68b /kernel/exit.c | |
| parent | 7b98cf0cf4e8798b9e7435f966ed0d90a2a925de (diff) | |
| parent | fdd85ec3eb8cc1b663678a3efa16ee59a32e0277 (diff) | |
Merge branch 'common/pinctrl' into sh-latest
Diffstat (limited to 'kernel/exit.c')
| -rw-r--r-- | kernel/exit.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 34867cc5b42..2f59cc33451 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -72,6 +72,18 @@ static void __unhash_process(struct task_struct *p, bool group_dead) list_del_rcu(&p->tasks); list_del_init(&p->sibling); __this_cpu_dec(process_counts); + /* + * If we are the last child process in a pid namespace to be + * reaped, notify the reaper sleeping zap_pid_ns_processes(). + */ + if (IS_ENABLED(CONFIG_PID_NS)) { + struct task_struct *parent = p->real_parent; + + if ((task_active_pid_ns(parent)->child_reaper == parent) && + list_empty(&parent->children) && + (parent->flags & PF_EXITING)) + wake_up_process(parent); + } } list_del_rcu(&p->thread_group); } @@ -643,6 +655,7 @@ static void exit_mm(struct task_struct * tsk) mm_release(tsk, mm); if (!mm) return; + sync_mm_rss(mm); /* * Serialize with any possible pending coredump. * We must hold mmap_sem around checking core_state @@ -719,12 +732,6 @@ static struct task_struct *find_new_reaper(struct task_struct *father) zap_pid_ns_processes(pid_ns); write_lock_irq(&tasklist_lock); - /* - * We can not clear ->child_reaper or leave it alone. - * There may by stealth EXIT_DEAD tasks on ->children, - * forget_original_parent() must move them somewhere. - */ - pid_ns->child_reaper = init_pid_ns.child_reaper; } else if (father->signal->has_child_subreaper) { struct task_struct *reaper; |
