microtime(9) on QEMU

View: New views
4 Messages — Rating Filter:   Alert me  

microtime(9) on QEMU

by David Young :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm running NetBSD-current of a few weeks ago on QEMU. microtime(9) does
not return a timeval greater than or equal to {.tv_sec = 3, .tv_usec
= 0}. .tv_usec does increase and, I suppose, wrap.  This causes, for
example, isv_match() to hang forever waiting for 4/30ths of a second to
pass.

The microtime(9) manual page sets my expectation that microtime(9) is
monotonically non-decreasing.  Is QEMU just broken?  Are there any
conditions (such as elevated IPL) where I should expect for the "seconds
hand" to stop, but the "microseconds hand" to keep "rotating"?

Dave

--
David Young             OJC Technologies
dyoung@...      Urbana, IL * (217) 278-3933

Re: microtime(9) on QEMU

by Joerg Sonnenberger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Oct 31, 2009 at 06:53:11PM -0500, David Young wrote:
> The microtime(9) manual page sets my expectation that microtime(9) is
> monotonically non-decreasing.  Is QEMU just broken?  Are there any
> conditions (such as elevated IPL) where I should expect for the "seconds
> hand" to stop, but the "microseconds hand" to keep "rotating"?

The only situation in which microtime(9) should ever be non-monotonic is
when faced with very long times of very high IPL. E.g. it is not always
possible and handle a time counter wrap around. So as long as the
timer interrupt runs often enough, it should not be an issue and
everything else is a bug.

Joerg

Re: microtime(9) on QEMU

by Joerg Sonnenberger :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 01, 2009 at 12:58:27AM +0100, Joerg Sonnenberger wrote:

> On Sat, Oct 31, 2009 at 06:53:11PM -0500, David Young wrote:
> > The microtime(9) manual page sets my expectation that microtime(9) is
> > monotonically non-decreasing.  Is QEMU just broken?  Are there any
> > conditions (such as elevated IPL) where I should expect for the "seconds
> > hand" to stop, but the "microseconds hand" to keep "rotating"?
>
> The only situation in which microtime(9) should ever be non-monotonic is
> when faced with very long times of very high IPL. E.g. it is not always
> possible and handle a time counter wrap around. So as long as the
> timer interrupt runs often enough, it should not be an issue and
> everything else is a bug.

Make that microuptime as microtime itself is of course effected by
settimeofday and related interfaces.

Joerg

Re: microtime(9) on QEMU

by David Young :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 01, 2009 at 12:58:27AM +0100, Joerg Sonnenberger wrote:
> The only situation in which microtime(9) should ever be non-monotonic is
> when faced with very long times of very high IPL. E.g. it is not always
> possible and handle a time counter wrap around. So as long as the
> timer interrupt runs often enough, it should not be an issue and
> everything else is a bug.

Jörg,

Thanks for the information.  I will check the IPL.  With the patches
under test, IPL "leakage" is possible.

Dave

--
David Young             OJC Technologies
dyoung@...      Urbana, IL * (217) 278-3933