signal: Allow RT tasks to cache one sigqueue struct
Quoted 22 lines · Thomas Gleixner
Quoted 21 lines · Oleg Nesterov
Quoted 19 lines · Thomas Gleixner
Quoted 9 lines · Oleg Nesterov
Review
Quoted 6 lines
(quoted diff) +6
-0+static bool sigqueue_add_cache(struct task_struct *t, struct sigqueue *q) +{ + if (!t->sigqueue_cache && cmpxchg(&t->sigqueue_cache, NULL, q) == NULL) + return true; + return false; +}Do we really need cmpxchg? It seems they are always called with spinlock held.
With which spinlock held?
__send_signal()<-sighand::siglockheld
__sigqueue_alloc()
alloc_posix_timer()
sigqueue_alloc()<- No lock held__sigqueue_alloc()
Quoted 6 lines
Quoted 6 lines
In the last case "fromslab" is true,
sigqueue_from_cache()won't be called.Quoted 2 lines
and on the free side we have a bunch of callers which do not hold
sighand::siglockeither.Where?
Bah. I confused myself. Let me start over with that.
Thanks,
tglx