Skip to contentSkip to conversation

wait_task_zombie: remove unneeded child->signal check

PATCH In review Oleg Nesterov 2 participants 3 messages Aug 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 wait_task_zombie: remove unneeded child->signal check

A zombie must have a valid ->signal, we are going to release it and __exit_signal() starts with BUG_ON(!sig).

kernel/exit.c renamed from kernel/exit.c~1_SIGCK +1 -1
@@ -1210,7 +1210,7 @@ static int wait_task_zombie(struct task_
 		return 0;
 	}
 
-	if (likely(p->real_parent == p->parent) && likely(p->signal)) {
+	if (likely(p->real_parent == p->parent)) {
 		struct signal_struct *psig;
 		struct signal_struct *sig;
 
#1 lore raw
Quoted 2 lines

A zombie must have a valid ->signal, we are going to release it and __exit_signal() starts with BUG_ON(!sig).

Yes, this is safe because it's after the EXIT_DEAD check under tasklist_lock.

Thanks,
Roland

#2 lore raw
Quoted 5 lines · Roland McGrath
Quoted 3 lines

A zombie must have a valid ->signal, we are going to release it and __exit_signal() starts with BUG_ON(!sig).

Yes, this is safe because it's after the EXIT_DEAD check under tasklist_lock.

Yes thanks, the changelog could be better.

We "own" this child (it was us sho set EXIT_DEAD), nobody can release it including the child itself (it already passed exit_notify()). We could even drop tasklist, but we need ->parent->sighand->siglock.

Oleg.