public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm 3/3] exit: move taskstats_tgid_free() from __exit_signal() to free_signal_struct()
@ 2010-03-21 18:47 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2010-03-21 18:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Balbir Singh, Roland McGrath, linux-kernel

Move taskstats_tgid_free() from __exit_signal() to free_signal_struct().

This way signal->stats never points to nowhere and we can read ->stats
lockless.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---

 kernel/exit.c |    1 -
 kernel/fork.c |    1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

--- 34-rc1/kernel/exit.c~13_SIGNAL_STATS	2010-03-21 18:34:02.000000000 +0100
+++ 34-rc1/kernel/exit.c	2010-03-21 18:36:44.000000000 +0100
@@ -145,7 +145,6 @@ static void __exit_signal(struct task_st
 	clear_tsk_thread_flag(tsk,TIF_SIGPENDING);
 	if (group_dead) {
 		flush_sigqueue(&sig->shared_pending);
-		taskstats_tgid_free(sig);
 		tty_kref_put(tty);
 	}
 }
--- 34-rc1/kernel/fork.c~13_SIGNAL_STATS	2010-03-21 18:35:01.000000000 +0100
+++ 34-rc1/kernel/fork.c	2010-03-21 18:37:31.000000000 +0100
@@ -160,6 +160,7 @@ EXPORT_SYMBOL(free_task);
 
 static inline void free_signal_struct(struct signal_struct *sig)
 {
+	taskstats_tgid_free(sig);
 	kmem_cache_free(signal_cachep, sig);
 }
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-21 18:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-21 18:47 [PATCH -mm 3/3] exit: move taskstats_tgid_free() from __exit_signal() to free_signal_struct() Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox