select() returning early from timeouts ? (on qemu, HEAD and RELENG_8)

Luigi Rizzo rizzo at
Sat Dec 26 15:38:23 UTC 2009

while doing some tests with picobsd images on qemu, i noticed
that "ping" runs too fast (approx every 0.4s instead of 1s)
Upon investigation, the problem seems related to
	retval =  select(..., &timeout)
returning a retval of 0 way before the timeout has elapsed
(at least, according to a gettimeofday which is run right after).

My host system is FreeBSD 7.2-stable i386 with qemu.
In the guest (which is built using picobsd 'bridge') i set
A guest based on RELENG_7 works fine, whereas HEAD and RELENG_8
exhibit the problem.
Easy way to check:

	time ping -c 21 localhost
(or, on picobsd "date; ping -c 21 localhost; date" )

you should see a real time of 20 seconds (I see 8s on my system).

I was wondering if someone can try the above on real hardware
and let me know.

Even if just related to qemu or some ACPI/timecounter config, it
would be good to know where this comes from.

BTW I don't think this is related to the bug reported in september
of timeouts firing one tick late.

I am going to try various HEAD versions to see where the issue came
out, but it might be a bit time-consuming so if you have suggestions
on possible causes I'd be glad to know.


More information about the freebsd-current mailing list