[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120412080948.26401.23572.stgit@zurg>
Date: Thu, 12 Apr 2012 12:09:48 +0400
From: Konstantin Khlebnikov <khlebnikov@...nvz.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Hugh Dickins <hughd@...gle.com>, Oleg Nesterov <oleg@...hat.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Markus Trippelsdorf <markus@...ppelsdorf.de>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: [PATCH 1/2] mm: set task exit code before complete_vfork_done()
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 <khlebnikov@...nvz.org>
Cc: Oleg Nesterov <oleg@...hat.com>
---
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);
exit_mm(tsk);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists