Messages in this thread | | | Date | Sat, 20 Nov 2004 17:40:11 +0100 | From | Ingo Molnar <> | Subject | Re: kernel/sched.c: fix subtle TASK_RUNNING compare |
| |
* Domen Puncer <domen@coderock.org> wrote:
> On 20/11/04 13:53 +0100, Ingo Molnar wrote: > > > > * janitor@sternwelten.at <janitor@sternwelten.at> wrote: > > > > > switch_count = &prev->nivcsw; > > > - if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) { > > > + if (prev->state != TASK_RUNNING && > > > + !(preempt_count() & PREEMPT_ACTIVE)) { > > > switch_count = &prev->nvcsw; > > > > nack. We inherently rely on the process state mask being a bitmask and > > TASK_RUNNING thus being zero. > > Hmm... but other compares in sched.c are ok? ;-) > 1211: BUG_ON(p->state != TASK_RUNNING); > 2550: if (unlikely(current == rq->idle) && current->state != TASK_RUNNING) { > 3609: if (state == TASK_RUNNING) > 3640: if (state != TASK_RUNNING)
hm ... ok.
Ingo - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |