Re: Timekeeping and scheduling

  • From: Martin Lucina <martin@xxxxxxxxxx>
  • To: rumpkernel-users@xxxxxxxxxxxxx
  • Date: Fri, 6 Mar 2015 11:56:24 +0100

pooka@xxxxxx said:
> rump_schedule() schedules a *rump kernel cpu*, not a host thread.
> sched_yield() yields the *host thread*.
> 
> The problem is that the code you posted is essentially a busy loop.
> Since the current timekeeping driver depends on the clock interrupt
> running, and since all interrupts in rump kernels are threads, the
> clock interrupt never runs because the *host thread* the interrupt
> uses is not scheduled in a busy loop.

*slaps self with a wet fish*

Right. And the reason the code works on POSIX without sched_yield() is
because the host scheduler (Linux) is preemptive whereas the -bmk and -xen
host schedulers are cooperative.

> Now, there are actually two issues to consider:
> 
> 1) accurate timekeeping which has >clockintr resolution
> 2) detecting if interrupts are pending, and yielding the *host
> thread* in rump_un/schedule() if so

or, eventually, 3) replace/enhance the -xen and -bmk platforms with a
preemptive host scheduler.


Other related posts: