Re: scheduler ignores need_resched flag in 2.2.x and 2.3.x?

From: yodaiken@fsmlabs.com
Date: Tue Mar 21 2000 - 10:58:59 EST


On Tue, Mar 21, 2000 at 12:33:25PM +0000, Alan Cox wrote:
> > This is what makes Ingo's latency patch less dangerous: need_resched is hard
> > to set. Your scenario requires that an interrupt routine, interrupting
> > kernel mode, set needs_resched. Where does this happen?
>
> A process wake from interrupt state - eg a network event. Its not actually
> that uncommon. The window is small however so it isnt likely to get hit
> much.

The scheduler is too complex for me. So the confusingly named
"reschedule_idle" is called on wake and if preemption_goodness
tells it to, it can set need_resched, which as Jun Sun, points out, can belong
to a process that is in the middle of being replaced by a second process.
Ok. That makes sense and his fix seems reasonable: need
          current->needs_resched = (prev->needs_resched?1:current->needs_resched);
in __schedule_tail

Thanks.

BTW: the comments on schedule, that it is simple and nice and that "the goto" is
     interesting are out of date.

-- 
---------------------------------------------------------
Victor Yodaiken 
FSMLabs:  www.fsmlabs.com  www.rtlinux.com
FSMLabs is a servicemark and a service of 
VJY Associates L.L.C, New Mexico.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:33 EST