netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Peter Hurley <peter@hurleysoftware.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Sree Harsha Totakura <sreeharsha@totakura.in>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Jeff Dike <jdike@addtoit.com>, Ingo Molnar <mingo@elte.hu>
Subject: [PATCH 2/2] exit: move check_stack_usage() to the end of do_exit()
Date: Mon, 17 Mar 2014 19:05:10 +0100	[thread overview]
Message-ID: <20140317180510.GC15708@redhat.com> (raw)
In-Reply-To: <20140317180416.GA15708@redhat.com>

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>
---
 kernel/exit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 5d5b472..6d1f245 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -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);
-- 
1.5.5.1

  parent reply	other threads:[~2014-03-17 18:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <531A37FF.4000509@totakura.in>
2014-03-10 16:56 ` pppd service crash in linux-3.13.6 Sree Harsha Totakura
2014-03-10 19:23   ` Peter Hurley
2014-03-13 17:06     ` Oleg Nesterov
2014-03-13 17:55       ` Peter Hurley
2014-03-14 14:19         ` Peter Hurley
2014-03-14 15:02           ` Peter Hurley
2014-03-14 19:23           ` Oleg Nesterov
2014-03-14 20:28             ` Peter Hurley
2014-03-14 21:04               ` Oleg Nesterov
2014-03-15 12:49                 ` Peter Hurley
2014-03-17 18:04                   ` [PATCH 0/2] (Was: pppd service crash in linux-3.13.6) Oleg Nesterov
2014-03-17 18:04                     ` [PATCH 1/2] exit: call disassociate_ctty() before exit_task_namespaces() Oleg Nesterov
2014-03-17 18:05                     ` Oleg Nesterov [this message]
2014-03-10 19:54   ` pppd service crash in linux-3.13.6 Ben Hutchings
2014-03-12 21:25     ` Sree Harsha Totakura

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140317180510.GC15708@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=sreeharsha@totakura.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).