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 /include/linux | |
| 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 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index ddc0df7f8b..bbcfc873bd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -355,16 +355,8 @@ struct sighand_struct { | |||
| 355 | atomic_t count; | 355 | atomic_t count; |
| 356 | struct k_sigaction action[_NSIG]; | 356 | struct k_sigaction action[_NSIG]; |
| 357 | spinlock_t siglock; | 357 | spinlock_t siglock; |
| 358 | struct rcu_head rcu; | ||
| 359 | }; | 358 | }; |
| 360 | 359 | ||
| 361 | extern void sighand_free_cb(struct rcu_head *rhp); | ||
| 362 | |||
| 363 | static inline void sighand_free(struct sighand_struct *sp) | ||
| 364 | { | ||
| 365 | call_rcu(&sp->rcu, sighand_free_cb); | ||
| 366 | } | ||
| 367 | |||
| 368 | /* | 360 | /* |
| 369 | * NOTE! "signal_struct" does not have it's own | 361 | * NOTE! "signal_struct" does not have it's own |
| 370 | * locking, because a shared signal_struct always | 362 | * locking, because a shared signal_struct always |
