]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
exit: move check_stack_usage() to the end of do_exit()
authorOleg Nesterov <oleg@redhat.com>
Mon, 7 Apr 2014 22:38:30 +0000 (15:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 Apr 2014 23:36:04 +0000 (16:36 -0700)
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>
kernel/exit.c

index 11f9e39a73684bf2370f2c4392f055e52d92be26..171c9a9d7b006479c1594780152ea38c6085d0a3 100644 (file)
@@ -788,7 +788,6 @@ void do_exit(long code)
                disassociate_ctty(1);
        exit_task_namespaces(tsk);
        exit_task_work(tsk);
-       check_stack_usage();
        exit_thread();
 
        /*
@@ -842,6 +841,7 @@ void do_exit(long code)
 
        validate_creds_for_do_exit(tsk);
 
+       check_stack_usage();
        preempt_disable();
        if (tsk->nr_dirtied)
                __this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied);