aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-01-27 06:29:13 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-01-27 06:29:37 -0500
commitf97b12cce6dea51880a6a89d4607c29c70a6a841 (patch)
tree1f05f6d39975bd213e7506e8a73ae0a59188c75e /kernel/exit.c
parentccaa8d657117bb1876d471bd91579d774106778d (diff)
parent1bae4ce27c9c90344f23c65ea6966c50ffeae2f5 (diff)
Merge commit 'v2.6.38-rc2' into core/locking
Reason: Update to mainline before adding the locking cleanup Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 21aa7b3001fb..f9a45ebcc7b1 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -69,7 +69,7 @@ static void __unhash_process(struct task_struct *p, bool group_dead)
69 69
70 list_del_rcu(&p->tasks); 70 list_del_rcu(&p->tasks);
71 list_del_init(&p->sibling); 71 list_del_init(&p->sibling);
72 __get_cpu_var(process_counts)--; 72 __this_cpu_dec(process_counts);
73 } 73 }
74 list_del_rcu(&p->thread_group); 74 list_del_rcu(&p->thread_group);
75} 75}
@@ -914,6 +914,15 @@ NORET_TYPE void do_exit(long code)
914 if (unlikely(!tsk->pid)) 914 if (unlikely(!tsk->pid))
915 panic("Attempted to kill the idle task!"); 915 panic("Attempted to kill the idle task!");
916 916
917 /*
918 * If do_exit is called because this processes oopsed, it's possible
919 * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before
920 * continuing. Amongst other possible reasons, this is to prevent
921 * mm_release()->clear_child_tid() from writing to a user-controlled
922 * kernel address.
923 */
924 set_fs(USER_DS);
925
917 tracehook_report_exit(&code); 926 tracehook_report_exit(&code);
918 927
919 validate_creds_for_do_exit(tsk); 928 validate_creds_for_do_exit(tsk);
@@ -985,6 +994,15 @@ NORET_TYPE void do_exit(long code)
985 exit_fs(tsk); 994 exit_fs(tsk);
986 check_stack_usage(); 995 check_stack_usage();
987 exit_thread(); 996 exit_thread();
997
998 /*
999 * Flush inherited counters to the parent - before the parent
1000 * gets woken up by child-exit notifications.
1001 *
1002 * because of cgroup mode, must be called before cgroup_exit()
1003 */
1004 perf_event_exit_task(tsk);
1005
988 cgroup_exit(tsk, 1); 1006 cgroup_exit(tsk, 1);
989 1007
990 if (group_dead) 1008 if (group_dead)
@@ -998,11 +1016,6 @@ NORET_TYPE void do_exit(long code)
998 * FIXME: do that only when needed, using sched_exit tracepoint 1016 * FIXME: do that only when needed, using sched_exit tracepoint
999 */ 1017 */
1000 flush_ptrace_hw_breakpoint(tsk); 1018 flush_ptrace_hw_breakpoint(tsk);
1001 /*
1002 * Flush inherited counters to the parent - before the parent
1003 * gets woken up by child-exit notifications.
1004 */
1005 perf_event_exit_task(tsk);
1006 1019
1007 exit_notify(tsk, group_dead); 1020 exit_notify(tsk, group_dead);
1008#ifdef CONFIG_NUMA 1021#ifdef CONFIG_NUMA