[coyotos-dev] Usermode interrupt handling delayed until end of quanta?
Jonathan S. Shapiro
shap at eros-os.com
Wed Jan 23 16:18:12 EST 2008
On Wed, 2008-01-23 at 16:02 -0500, Jeroen C. Visser wrote:
> I did notice that a user-mode process interrupted by an IRQ gets to
> finish its quantum before the IRQ handler process is scheduled. I used
> the following patch to make things work even with 1 second quanta. I
> bet you it is incorrect in some way or other :)
Yes. It's most definitely wrong. The dispatched handler should preempt
the currently running process exactly (and only) if it has higher
priority. So your patch introduces exactly the wrong behavior. The
correct approach is to run the serial driver at higher priority. You
will then discover that priority-based dispatch isn't yet implemented,
which is the real problem.
In order to fix that:
(1) the ready queue needs a better design so that it will handle
priorities better, and
(2) insert onto the ready queue needs to do the preemption check.
More information about the coyotos-dev