diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-03-28 19:11:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-28 21:36:42 -0500 |
commit | aa1757f90bea3f598b6e5d04d922a6a60200f1da (patch) | |
tree | 4f8f3804b2595031d0b84de7086dc28375290f0d /kernel/signal.c | |
parent | 1f09f9749cdde4e69f95d62d96d2e03f50b3353c (diff) |
[PATCH] convert sighand_cache to use SLAB_DESTROY_BY_RCU
This patch borrows a clever Hugh's 'struct anon_vma' trick.
Without tasklist_lock held we can't trust task->sighand until we locked it
and re-checked that it is still the same.
But this means we don't need to defer 'kmem_cache_free(sighand)'. We can
return the memory to slab immediately, all we need is to be sure that
sighand->siglock can't dissapear inside rcu protected section.
To do so we need to initialize ->siglock inside ctor function,
SLAB_DESTROY_BY_RCU does the rest.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index dc8f91bf9f89..b0b1ca9daa33 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -330,7 +330,7 @@ void __exit_sighand(struct task_struct *tsk) | |||
330 | /* Ok, we're done with the signal handlers */ | 330 | /* Ok, we're done with the signal handlers */ |
331 | tsk->sighand = NULL; | 331 | tsk->sighand = NULL; |
332 | if (atomic_dec_and_test(&sighand->count)) | 332 | if (atomic_dec_and_test(&sighand->count)) |
333 | sighand_free(sighand); | 333 | kmem_cache_free(sighand_cachep, sighand); |
334 | } | 334 | } |
335 | 335 | ||
336 | void exit_sighand(struct task_struct *tsk) | 336 | void exit_sighand(struct task_struct *tsk) |