On Thu, Apr 19, 2007 at 12:26:53AM -0400, Jeff Dike wrote:
> Do you really care about gettimeofday?  That is tied to the host, in
> the sense that the UML gtod calls the host's gtod.  However, sleeps
> inside UML should behave as you want.  If you can demonstrate
> otherwise, please do.

Right, it's the sleeps I care about; gettimeofday is trivial.

Here is an example. I just coded up two programs -- one to run in UML,
and one to run in the host. The UML program simply calls nanosleep()
to sleep for 10 seconds. The host program sends "stop" to the mconsole
through a socket, sleeps for 15 seconds, and then sends "go".

---------- snip
1176957979.606483 [UML] Trying to nanosleep for 10 seconds
1176957980.633799 [HOST] Sent "stop" to UML
1176957995.634926 [HOST] Sent "go" to UML
1176957995.655234 [UML] Woke up with 0.000000000 seconds remaining
---------- snip

Thus, from a UML-internal perspective, the process only slept for
about a second, but it thinks it has slept at least 10.

I should make a comment about my kernels at this point, since this is
clearly unexpected behavior.

 * Host kernel: Linux 2.6.17-hrt-dyntick5-skas3-v9-pre9
 * UML kernel: Linux 2.6.18.3

For the host, the hrt-dyntick5 patch is for high-resolution timers.
I'm fairly certain that I saw the same behavior exemplified above
/without/ this patch applied, but I could double-check if you think
it might be a contributing factor.

Thanks for your quick responses, by the way.

Greg

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to