> On Thu, 24 Jan 2008 03:01:53 +0800 "Wang Nan" <wn.at.lkml@gmail.com> wrote:
It does look a bit odd. IIRC, cond_resched() is special, in that if it is
called in state TASK_INTERRUPTIBLE it will _not_ return in state
TASK_RUNNING after having called schedule().
Search for PREEMPT_ACTIVE in kernel/sched.c. See if you can work out what
this code:
if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {
if (unlikely((prev->state & TASK_INTERRUPTIBLE) &&
unlikely(signal_pending(prev)))) {
prev->state = TASK_RUNNING;
} else {
deactivate_task(rq, prev, 1);
}
switch_count = &prev->nvcsw;
}
is doing, then send a patch which adds the missing comment :)
--