git-blame on kernel/exit.c shows that the offending line of code comes from the following commit:
commit 14bf01bb0599c89fc7f426d20353b76e12555308
Author: Linus Torvalds <email address hidden>
Date: Sat Oct 1 11:04:18 2005 -0700
Fix inequality comparison against "task->state"
We should always use bitmask ops, rather than depend on some ordering of
the different states. With the TASK_NONINTERACTIVE flag, the inequality
doesn't really work.
Oleg Nesterov argues (likely correctly) that this test is unnecessary in
the first place. However, the minimal fix for now is to at least make
it work in the presense of TASK_NONINTERACTIVE. Waiting for consensus
from Roland & co on potential bigger cleanups.
This is just a style-changed caused by the addition of a new task; the behaviour should have been consistent with the previous code (currently building a due-diligence kernel to test this assumption).
Unfortunately the previous code exists in the original import of the source tree into git, so there is no annotation history for why that line was introduced.
git-blame on kernel/exit.c shows that the offending line of code comes from the following commit:
commit 14bf01bb0599c89 fc7f426d20353b7 6e12555308
Author: Linus Torvalds <email address hidden>
Date: Sat Oct 1 11:04:18 2005 -0700
Fix inequality comparison against "task->state"
We should always use bitmask ops, rather than depend on some ordering of
the different states. With the TASK_NONINTERACTIVE flag, the inequality
doesn't really work.
Oleg Nesterov argues (likely correctly) that this test is unnecessary in TIVE. Waiting for consensus
the first place. However, the minimal fix for now is to at least make
it work in the presense of TASK_NONINTERAC
from Roland & co on potential bigger cleanups.
Signed-off-by: Linus Torvalds <email address hidden>
diff --git a/kernel/exit.c b/kernel/exit.c stopped( task_t *p, int delayed_group_
index ee6d8b8..4307773 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1203,7 +1203,7 @@ static int wait_task_
if (unlikely(
- unlikely(p->state > TASK_STOPPED))
+ unlikely(p->state & TASK_TRACED))
This is just a style-changed caused by the addition of a new task; the behaviour should have been consistent with the previous code (currently building a due-diligence kernel to test this assumption).
Unfortunately the previous code exists in the original import of the source tree into git, so there is no annotation history for why that line was introduced.