Skip to contentSkip to conversation

KVM test: new test timedrift_with_migration

PATCH Michael Goldish 1 participant 1 message Oct 12, 2009 1 message not in the archive KVM

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 2046637733.55331255364857083.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com

#1 lore raw
Quoted 54 lines · ----- "Lucas Meneghel Rodrigues

Hi Michael, I am reviewing your patchset and have just a minor remark to make here:

Quoted 1 line · Michael Goldish

This patch adds a new test that checks the timedrift introduced by

migrations.

Quoted 1 line

It uses the same parameters used by the timedrift test to get the

guest time.

Quoted 1 line

In addition, the number of migrations the test performs is

controlled by the

Quoted 6 lines

parameter 'migration_iterations'.

---
 client/tests/kvm/kvm_tests.cfg.sample              |   33 ++++--- client/tests/kvm/tests/timedrift_with_migration.py |   95

++++++++++++++++++++

Quoted 2 lines
 2 files changed, 115 insertions(+), 13 deletions(-)

 create mode 100644

client/tests/kvm/tests/timedrift_with_migration.py

Review

Quoted 2 lines
(quoted diff) +0 -0

b/client/tests/kvm/kvm_tests.cfg.sample

Quoted 6 lines

index 540d0a2..618c21e 100644

client/tests/kvm/kvm_tests.cfg.sample +0 -0
@@ -100,19 +100,26 @@ variants:

        type = linux_s3

Quoted 11 lines

    - timedrift:    install setup
-        type = timedrift
        extra_params += " -rtc-td-hack"
-        # Pin the VM and host load to CPU #0
-        cpu_mask = 0x1
-        # Set the load and rest durations
-        load_duration = 20
-        rest_duration = 20
-        # Fail if the drift after load is higher than 50%
-        drift_threshold = 50
-        # Fail if the drift after the rest period is higher than

10%

Quoted 11 lines

-        drift_threshold_after_rest = 10
-        # For now, make sure this test is executed alone
-        used_cpus = 100
+        variants:
+            - with_load:
+                type = timedrift
+                # Pin the VM and host load to CPU #0
+                cpu_mask = 0x1
+                # Set the load and rest durations
+                load_duration = 20
+                rest_duration = 20

Quoted 5 lines

Even the default duration here seems way too brief here, is there any reason why 20s was chosen instead of, let's say, 1800s? I am under the
impression that 20s of load won't be enough to cause any noticeable drift...

Apparently I've been working with a bad qemu version for quite a while, because after 20s of load I often get a huge (80%) drift. This normally shouldn't happen. We might want to wait a little longer than 20s, but there's no need to wait as long as 1800s AFAIK. The test is meant to catch drift problems, and apparently when there's a problem, it reveals itself quickly. I'm not sure there are drift problems that reveal themselves after only 1800s of load, but quite frankly, I know very little about this, so the timeout value should be changed by the user.

Quoted 10 lines
Quoted 3 lines

+                # Fail if the drift after load is higher than 50%
+                drift_threshold = 50
+                # Fail if the drift after the rest period is higher

than 10%

Quoted 1 line

+                drift_threshold_after_rest = 10

I am also curious about those tresholds and the reasoning behind them.
Is there any official agreement on what we consider to be an unreasonable drift?

I really don't know. After asking around I got the impression that the threshold should depend on the load. Theoretically it should be possible to get any amount of drift with enough load -- that's the way I see it, but I'm really not sure.

Maybe the best thing for us to do is run the time drift test a few times with functional qemu versions as well as with broken ones (but not as broken as the one I'm using), so we can see what thresholds best differentiate between functional and broken code.

Quoted 11 lines

Another thing that struck me out is drift calculation: On the original
timedrift test, the guest drift is normalized against the host drift:

drift = 100.0 * (host_delta - guest_delta) / host_delta

While in the new drift tests, we consider only the guest drift. I believe is better to normalize all tests based on one drift calculation criteria, and those values should be reviewed, and at least a certain level of agreement on our development community should be reached.

The new tests use the host clock as reference like the original test. We check how much time passed on the host, and then how much time passed in the guest, and take the difference between those two. The result is an absolute number of seconds because there's no "load duration" with which to normalize the result. We're just interested in how much drift is caused by a single reboot or a single migration (or a few). I don't think it matters how long the reboot/migration procedure took -- we treat it as a single discrete event.

Quoted 5 lines

Other than this concern that came to my mind, the new tests look good and work fine here. I had to do a slight rebase in one of the patches,
very minor stuff. The default values and the drift calculation can be changed on a later time. Thanks!

Since the two new tests are similar it may be a good idea to merge them into one and put just the differing code in conditional blocks, e.g.

(common code)
if op == "migration":
(migration code)
elif op == "reboot":
(reboot code)
(common code)

And where we use logging.info() we can do something like:
logging.info("Drift after %d %ss: %s seconds" % (iterations, op, drift)) so for reboot we get "Drift after 5 reboots: 3 seconds".

If you think this is a good idea, we can do it in a different patch, or we can do it now. I'm not even sure it's nececssary because the tests are rather simple as they are. Another question is what to call the merged test -- timedrift with what?

Thanks,
Michael