Skip to contentSkip to conversation

+ wait-completely-ignore-the-exit_dead-tasks.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Feb 21, 2014

lore
Share & tools
lore
#0 lore raw

Subject: + wait-completely-ignore-the-exit_dead-tasks.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 21 Feb 2014 13:39:20 -0800

The patch titled
Subject: wait: completely ignore the EXIT_DEAD tasks
has been added to the -mm tree. Its filename is
wait-completely-ignore-the-exit_dead-tasks.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/wait-completely-ignore-the-exit_dead-tasks.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/wait-completely-ignore-the-exit_dead-tasks.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Oleg Nesterov <[email protected]>
Subject: wait: completely ignore the EXIT_DEAD tasks

Now that EXIT_DEAD is the terminal state it doesn't make sense to call eligible_child() or security_task_wait() if the task is really dead.

Cc Jan Kratochvil <[email protected]>
Cc Al Viro <[email protected]>
Cc Lennart Poettering <[email protected]>
Cc Roland McGrath <[email protected]>
Cc Tejun Heo <[email protected]>

---

 kernel/exit.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
kernel/exit.c renamed from kernel/exit.c~wait-completely-ignore-the-exit_dead-tasks +6 -4
diff -puN kernel/exit.c~wait-completely-ignore-the-exit_dead-tasks kernel/exit.c
@@ -1331,7 +1331,12 @@ static int wait_task_continued(struct wa
 static int wait_consider_task(struct wait_opts *wo, int ptrace,
 				struct task_struct *p)
 {
-	int ret = eligible_child(wo, p);
+	int ret;
+
+	if (unlikely(p->exit_state == EXIT_DEAD))
+		return 0;
+
+	ret = eligible_child(wo, p);
 	if (!ret)
 		return ret;
 
@@ -1349,10 +1354,6 @@ static int wait_consider_task(struct wai
 		return 0;
 	}
 
-	/* dead body doesn't have much to contribute */
-	if (unlikely(p->exit_state == EXIT_DEAD))
-		return 0;