diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-04-07 18:38:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:36:04 -0400 |
commit | 4bcb8232cf4eb061b086c10f56b6808adcdb5a93 (patch) | |
tree | 808dd52c0e2addd49d1af7c4d51d1946c5477743 /kernel | |
parent | c39df5fa37b0623589508c95515b4aa1531c524e (diff) |
exit: move check_stack_usage() to the end of do_exit()
It is not clear why check_stack_usage() is called so early and thus it
never checks the stack usage in, say, exit_notify() or
flush_ptrace_hw_breakpoint() or other functions which are only called by
do_exit().
Move the callsite down to the last preempt_disable/schedule.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 11f9e39a7368..171c9a9d7b00 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -788,7 +788,6 @@ void do_exit(long code) | |||
788 | disassociate_ctty(1); | 788 | disassociate_ctty(1); |
789 | exit_task_namespaces(tsk); | 789 | exit_task_namespaces(tsk); |
790 | exit_task_work(tsk); | 790 | exit_task_work(tsk); |
791 | check_stack_usage(); | ||
792 | exit_thread(); | 791 | exit_thread(); |
793 | 792 | ||
794 | /* | 793 | /* |
@@ -842,6 +841,7 @@ void do_exit(long code) | |||
842 | 841 | ||
843 | validate_creds_for_do_exit(tsk); | 842 | validate_creds_for_do_exit(tsk); |
844 | 843 | ||
844 | check_stack_usage(); | ||
845 | preempt_disable(); | 845 | preempt_disable(); |
846 | if (tsk->nr_dirtied) | 846 | if (tsk->nr_dirtied) |
847 | __this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied); | 847 | __this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied); |