summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-09-28 23:44:18 +0200
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-10-29 10:07:18 -0700
commit392809b25833548ccfc55e61b76c8451a5073216 (patch)
tree9cffa1e96d8ecc7208fc3a3c9fc7ef8725d2aa55 /kernel/fork.c
parenteca1a08986f622c11b75b3b44d561a1f901c9cec (diff)
downloadlinux-392809b25833548ccfc55e61b76c8451a5073216.tar.gz
linux-392809b25833548ccfc55e61b76c8451a5073216.tar.bz2
linux-392809b25833548ccfc55e61b76c8451a5073216.zip
signal: Document the RCU protection of ->sighand
__cleanup_sighand() frees sighand without RCU grace period. This is correct but this looks "obviously buggy" and constantly confuses the readers, add the comments to explain how this works. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Steven Rostedt <rostedt@goodmis.org> Reviewed-by: Rik van Riel <riel@redhat.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 9b7d746d6d62..9ca84189cfc2 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1022,11 +1022,14 @@ void __cleanup_sighand(struct sighand_struct *sighand)
{
if (atomic_dec_and_test(&sighand->count)) {
signalfd_cleanup(sighand);
+ /*
+ * sighand_cachep is SLAB_DESTROY_BY_RCU so we can free it
+ * without an RCU grace period, see __lock_task_sighand().
+ */
kmem_cache_free(sighand_cachep, sighand);
}
}
-
/*
* Initialize POSIX timer handling for a thread group.
*/