public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 217516] FAIL: TSC reference precision test when do hyperv_clock test of kvm unit test
Date: Mon, 12 Jun 2023 09:20:49 +0000	[thread overview]
Message-ID: <bug-217516-28872-g4Gl1Tzcr6@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-217516-28872@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=217516

vkuznets@redhat.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bonzini@gnu.org,
                   |                            |vkuznets@redhat.com

--- Comment #4 from vkuznets@redhat.com ---
It seems this is just an unstable test. It merges the divergence between MSR
based clock and TSC page over one second and then expects delta to stay within
the measured range over another two seconds. This works well for a completely
idle system but if tasks get scheduled out, rescheduled to a different CPU,...
the test fails. Widening the range help, e.g.:

diff --git a/x86/hyperv_clock.c b/x86/hyperv_clock.c
index f1e7204a8ea9..57d25770a2d0 100644
--- a/x86/hyperv_clock.c
+++ b/x86/hyperv_clock.c
@@ -79,7 +79,7 @@ static void hv_clock_test(void *data)
                min_delta = delta < min_delta ? delta : min_delta;
                if (t < msr_sample) {
                        max_delta = delta > max_delta ? delta: max_delta;
-               } else if (delta < 0 || delta > max_delta * 3 / 2) {
+               } else if (delta < 0 || delta > max_delta * 1024) {
                        printf("suspecting drift on CPU %d? delta = %d,
acceptable [0, %d)\n", smp_id(),
                               delta, max_delta);
                        ok[i] = false;

but I wouldn't be surprised if on a busy system even '1024 * max_delta' is not
going to be sufficient. Maybe we should make this a warning and not fail the
whole test as I don't see
how we can make it reliable.

Paolo (as you're the author), wdyt?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

      parent reply	other threads:[~2023-06-12  9:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 12:04 [Bug 217516] New: FAIL: TSC reference precision test when do hyperv_clock test of kvm unit test bugzilla-daemon
2023-06-01 12:10 ` [Bug 217516] " bugzilla-daemon
2023-06-02 12:13 ` bugzilla-daemon
2023-06-05  3:17 ` bugzilla-daemon
2023-06-12  9:20 ` bugzilla-daemon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-217516-28872-g4Gl1Tzcr6@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox