From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx189.postini.com [74.125.245.189]) by kanga.kvack.org (Postfix) with SMTP id 289796B004A for ; Thu, 12 Apr 2012 19:35:10 -0400 (EDT) Date: Thu, 12 Apr 2012 16:35:07 -0700 From: Andrew Morton Subject: Re: [PATCH 1/2] mm: set task exit code before complete_vfork_done() Message-Id: <20120412163507.6b8c6d94.akpm@linux-foundation.org> In-Reply-To: <20120412080948.26401.23572.stgit@zurg> References: <20120409200336.8368.63793.stgit@zurg> <20120412080948.26401.23572.stgit@zurg> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Konstantin Khlebnikov Cc: Hugh Dickins , Oleg Nesterov , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Markus Trippelsdorf , KAMEZAWA Hiroyuki On Thu, 12 Apr 2012 12:09:48 +0400 Konstantin Khlebnikov wrote: > kthread_stop() uses task->vfork_done for synchronization. The exiting kthread > shouldn't do complete_vfork_done() until it sets ->exit_code. > > fix for mm-correctly-synchronize-rss-counters-at-exit-exec.patch > > Signed-off-by: Konstantin Khlebnikov > Cc: Oleg Nesterov > --- > kernel/exit.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/exit.c b/kernel/exit.c > index eb12719..70875a6 100644 > --- a/kernel/exit.c > +++ b/kernel/exit.c > @@ -960,6 +960,9 @@ void do_exit(long code) > > acct_update_integrals(tsk); > > + /* Set exit_code before complete_vfork_done() in mm_release() */ > + tsk->exit_code = code; > + > /* Release mm and sync mm's RSS info before statistics gathering */ > mm_release(tsk, tsk->mm); > > @@ -975,7 +978,6 @@ void do_exit(long code) > tty_audit_exit(); > audit_free(tsk); > > - tsk->exit_code = code; > taskstats_exit(tsk, group_dead); > So does this patch address Oleg's objection to mm-correctly-synchronize-rss-counters-at-exit-exec.patch? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org