Re: Accurate timers in rumpkernels on Xen / minios

  • From: George Dunlap <dunlapg@xxxxxxxxx>
  • To: pooka@xxxxxx
  • Date: Fri, 27 May 2016 14:30:00 +0100

On Fri, May 27, 2016 at 1:17 PM, Antti Kantee <pooka@xxxxxx> wrote:

Well, try this hacky patch.  It's not correct by any stretches of
imagination, nor am I promising to accept something like it into Rumprun,
but if you can repeat my results, at least we've narrowed down the problem.
In my testing the clock_gettime-to-clock_gettime delay for a 1ns sleep on
KVM is ~8us with this patch.

(btw, the init code might not in correct order as indicated by the comment,
try to hack around it somehow if that happens)

Thanks -- so I take it this just overwrites the current syscall, such
that my code as is (which calles nsleep()) should in theory Just Work
once the patch is applied properly?

It's a bit strange that NetBSD clips the sleep time to the clock HZ --
that seems like it's probably an artifact of a bygone age.

 -George

Other related posts: