|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] (Further timing queries) Re: Strange behavior of simple loop programs in Xen guests.
Arjun wrote: Anthony,Thanks for that. Are there any specific documents or links I can check out regarding this issue ? Try googling. I have another query along these lines :I have a simple java "Echo" client and server. In the client, I send a message of specific size to the server which echoes it back to the client and time the response. I use the java " System.currentTimeMillis()" function before and after the echo to measure the round-trip-time (RTT). Question is : if both my client and server programs are running inside Xen 3.0 guests, are the timing results trustworthy ? (Note that I'm measuring on a millisecond scale and am using the jdk1.5) In this case, you're measuring wall clock time. Since you're only interested in knowing the length of the period, your program will work just fine under Xen. Let me clarify things a little bit more. Let's say that your kernel keeps track of process CPU usage in the following manner. When a process starts to run, you check a high resolution timer. When the process stops running (due to preemption or IO blocking), you check the timer again and compute a delta and store that delta in the processes "total run time". You also add this delta to "total system run time". You can then calculate the percent CPU from dividing the processes "total run time" by the "total system run time". The problem here in virtualization is that while that process is running, it may be pre-empted to allow another guest to run. This means the delta that we calculate to measure the length that the process ran also includes how long the other guest had run. This extra time is typically referred to as "stolen time". As I mentioned before, to get proper CPU usage information in a guest, the kernel has to take "stolen time" into account. This is something that I believe z/Linux does and hopefully we can also do in xenolinux in the not to distant future. For now though, you cannot trust anything that relies on knowing how long a process has been using the CPU. Any other sort of time measurement will work as expected though. Regards, Anthony Liguori Thanks and regards ArjunOn 4/15/06, *Anthony Liguori* <aliguori@xxxxxxxxxx <mailto:aliguori@xxxxxxxxxx>> wrote: _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |