Skip to contentSkip to conversation

signal: Allow RT tasks to cache one sigqueue struct

PATCH Thomas Gleixner 1 participant 1 message Mar 10, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
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::siglock held
__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::siglock either.

Where?

Bah. I confused myself. Let me start over with that.

Thanks,

tglx