Skip to contentSkip to conversation

wait_task_zombie: don't fight with non-existing race with a dying ptracee

PATCH In review Oleg Nesterov 2 participants 2 messages Aug 17, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wait_task_zombie: don't fight with non-existing race with a dying ptracee

(textually depends on wait_task_zombie-remove-unneeded-child-signal-check.patch)

The "p->exit_signal == -1 && p->ptrace == 0" check and the comment are bogus. We already did exactly the same check in eligible_child(), we did not drop tasklist_lock since then, and both variables need write_lock(tasklist) to be changed.

kernel/exit.c renamed from kernel/exit.c~1_WTZ_NORACE +0 -7
@@ -1210,13 +1210,6 @@ static int wait_task_zombie(struct task_
 		BUG_ON(state != EXIT_DEAD);
 		return 0;
 	}
-	if (unlikely(p->exit_signal == -1 && p->ptrace == 0)) {
-		/*
-		 * This can only happen in a race with a ptraced thread
-		 * dying on another processor.
-		 */
-		return 0;
-	}
 
 	/* traced means p->ptrace, but not vice versa */
 	traced = (p->real_parent != p->parent);
#1 lore raw
Quoted 6 lines

(textually depends on wait_task_zombie-remove-unneeded-child-signal-check.patch)

The "p->exit_signal == -1 && p->ptrace == 0" check and the comment are bogus. We already did exactly the same check in eligible_child(), we did not drop tasklist_lock since then, and both variables need write_lock(tasklist) to be changed.

I think this is correct. IIRC, when the check was added, ->ptrace could be cleared some other way.

Thanks,
Roland