Skip to content

Commit

Permalink
exit: move taskstats_tgid_free() from __exit_signal() to free_signal_…
Browse files Browse the repository at this point in the history
…struct()

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>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed May 27, 2010
1 parent a705be6 commit 97101eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ static void __exit_signal(struct task_struct *tsk)
clear_tsk_thread_flag(tsk,TIF_SIGPENDING);
if (group_dead) {
flush_sigqueue(&sig->shared_pending);
taskstats_tgid_free(sig);
tty_kref_put(tty);
}
}
Expand Down
1 change: 1 addition & 0 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,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);
}

Expand Down

0 comments on commit 97101eb

Please sign in to comment.