From: Rusty R. <ru...@ru...> - 2007-10-30 10:52:23
|
On Tuesday 30 October 2007 18:37:36 Ingo Molnar wrote: > * Rusty Russell <ru...@ru...> wrote: > > No. tsc is very good, it's not perfect. If a paravirt clock > > registers 400 it really means "pick me over the tsc". > > often the TSC is not perfect, but _IF_ it's perfect, using the paravirt > driver is a pessimisation in performance. > > the main problem at the moment is that there's no mechanism at the > moment to convey to the guest the information that the TSC is "perfect", > and to convey the calibration values. The host can communicate to the guest what clock to use: the guest can decide to register a paravirt clock or not depending on whether it wants to leave it to the TSC. For a while we couldn't remove the TSC cpuid capability in the guest, because if you configured your kernel in some ways it was hardcoded on. I think the "all 686+ have a tsc" assumption has now been fixed, so I should change the lguest clock to do as you said: register its clock at lower prio to the TSC and then the host can simply remove the TSC cpuid if it isn't suitable for the guest to use. ISTR the core TSC timing code (which lguest could use) and various hardware manipulations (which lguest couldn't) were intertwined, but I'll have to go back and check exactly what the issue was. > and just in case it's not obvious: i am not arguing for the inclusion of > the patch Unfortunately, you and Thomas both acked the patch. This says v bad things about how much review kernel patches get. Cheers, Rusty. |
From: Glauber de O. C. <gc...@re...> - 2007-10-30 12:13:11
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ingo Molnar escreveu: > * Rusty Russell <ru...@ru...> wrote: > > and just in case it's not obvious: i am not arguing for the inclusion of > the patch, i'm just pointing out the plain fact that in the case where > the TSC _is_ reliable, 5 different clocksource drivers for has obvious > disadvantages. Anyone arguing against that simple point needs his head > examined :) Once we can pass around calibration information from the > host to the guest (which we dont do at the moment) there will be reason > not to use the native clocksource driver in the guest. If you sustain that we cannot have a reliable synchronization test mechanism, neither do I. All this is based in the assumption that a bad tsc will fail such tests. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Remi - http://enigmail.mozdev.org iD8DBQFHJyAHjYI8LaFUWXMRAtYoAJ9l5kNodRLfTsNHDvyioufM7SQzTACfarEy XXq3sDq9uxZ/72hhA46YmgM= =DwN/ -----END PGP SIGNATURE----- |
From: Glauber de O. C. <gc...@re...> - 2007-10-30 12:01:12
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Zachary Amsden escreveu: > On Tue, 2007-10-30 at 00:02 +0100, Ingo Molnar wrote: >> * Zachary Amsden <za...@vm...> wrote: > >>> Not every guest support paravirt, but for correctness, all guests >>> require TSC, which must be exposed all the way up to userspace, no >>> matter what the efficiency or accuracy may be. >> but if there's a perfect TSC available (there is such hardware) then the >> TSC _is_ the best clocksource. Paravirt now turns it off unconditionally >> in essence. > > No, if no paravirt clocksource is detected, nothing can override the > perfect TSC hardware clocksource rating of 400. And if a paravirt > clocksource is detected, it is always better than TSC. Why always? tsc is the best possible alternative the _platform_ can provide. So the paravirt clocksource will be at best, as good as tsc. And if it is the case: why bother with communication mechanisms of all kinds, calculations, etc, if we can just read the tsc? Noting again: If the tsc does not arrive accurate to the guest, it will fail the tsc clocksource tests. So it will be rated zero anyway -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Remi - http://enigmail.mozdev.org iD8DBQFHJx1KjYI8LaFUWXMRAv0hAJ4sj0Z1FraYrgbU5Mj0pWOJGk6jtwCfc5xL jpTC273X0oqPTCR7NcVHJOI= =WPzV -----END PGP SIGNATURE----- |
From: Zachary A. <za...@vm...> - 2007-10-30 17:57:53
|
On Tue, 2007-10-30 at 10:02 -0200, Glauber de Oliveira Costa wrote: > > No, if no paravirt clocksource is detected, nothing can override the > > perfect TSC hardware clocksource rating of 400. And if a paravirt > > clocksource is detected, it is always better than TSC. > > Why always? tsc is the best possible alternative the _platform_ can > provide. So the paravirt clocksource will be at best, as good as tsc. What is the justification for this claim? The TSC provides no information about frequency. The frequency must be measured from a known fixed rate source. This measurement is error prone, both on real hardware, and even more so in a VM. The TSC can only provide a single measure of elapsed periods. It has no concept to differentiate between elapsed periods of time spent in the guest, which is relevant to the scheduler, and elapsed periods of time spent in real time, which is relevant to timekeeping. So a TSC can not drive both timekeeping and scheduling in a virtual machine, or if it does, it does so inaccurately. > And if it is the case: why bother with communication mechanisms of all > kinds, calculations, etc, if we can just read the tsc? > > Noting again: If the tsc does not arrive accurate to the guest, it will > fail the tsc clocksource tests. So it will be rated zero anyway You always need to provide a TSC, and it will always initially appear to be accurate. Long term, as time is reported via the TSC is an approximation somewhere between real time and elapsed running time, measurements made using it in a VM will drift, and it is impossible to remove the inaccuracy from one end of the spectrum (by providing real time exactly) without compromising it at the other end (by skewing relative time measurement). A paravirt clocksource is always better than a TSC because it compensates for these effects. Zach |