On 27/05/16 11:13, Antti Kantee wrote:
Ok, seems like it should be possible.  I'm not sure what's happening,
maybe the sleep is somehow rounded up to HZ in the rump kernel.

Well, I thought I'd at least give the relevant code a look, since I know where to look. So yes, that's exactly what's happening, see nanosleep1() in src-netbsd/sys/kern/kern_time.c

Unfortunately, I don't think that's an easy thing to fix, because it would require quite a significant revamp in the clock code. You can crank up HZ, but it'll mean that periodic threads run very frequently, which is probably not what you want in a virtualized environment. If anything, we should be cranking HZ down.

You can implement nanosleep by calling bmk interfaces directly, but it's hackish. I could add another rump kernel interface to make it less hackish, but it would still be non-standard, so I guess it depends on how badly you want accurate sleeps for whatever it is that you're doing.

Reply via email to