a cleanup and a bugfix in the preemptive kernel:
- the PREEMPT_ACTIVE trick is not needed - schedule() should check for need_resched, we might miss a reschedule otherwise. the cleanup also fixes the bug. The only reason why i kept preempt_schedule() was to fix up p->state to TASK_RUNNING, to make it possible to preempt from places that mark the task TASK_UNINTERRUPTIBLE before adding the task to a waitqueue, and thus a preemption in that small window could cause the task to be removed from the runqueue erroneously.
Showing
Please register or sign in to comment