> With the appropriate locking, memory barriers and other
> relevant goo I think this would work...
Yah, I guess, but that isn't pretty at all ;)
Andrew, remember how we used to do it (and still do it in the 2.4
patch)? Wouldn't that work? Specifically, when we enter
preempt_schedule we set a flag value in preempt_count. This flag value
is checked at the top of schedule and, if set, we skip the first chunk
of code that handles sleeping tasks. The task->state never changes.
Upon leaving schedule and returning to preempt_schedule, we unset the
flag.
This allows us to preempt tasks in any state, without problems or
special cases. It also wasn't too much overhead - compared to now,
basically just:
if (unlikely(current->preempt_count() & PREEMPT_ACTIVE))
goto pick_next_task;
at the top of schedule().
Robert Love
-
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/