From: Rik van Riel <riel@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Wanpeng Li <kernellwp@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Wanpeng Li <wanpeng.li@hotmail.com>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
Radim <rkrcmar@redhat.com>
Subject: Re: [PATCH] sched/cputime: add steal clock warps handling during cpu hotplug
Date: Mon, 06 Jun 2016 21:24:09 -0400 [thread overview]
Message-ID: <1465262649.16365.151.camel@redhat.com> (raw)
In-Reply-To: <b17566fa-1943-3bda-28f3-f6e21a424d9c@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]
On Mon, 2016-06-06 at 15:40 +0200, Paolo Bonzini wrote:
>
> On 02/06/2016 15:59, Rik van Riel wrote:
> >
> > If a guest is saved to disk and later restored (eg. after
> > a host reboot), or live migrated to another host, I would
> > expect to get totally disjoint steal time statistics from
> > the "new run" of the guest (which is the same run of the
> > guest OS).
> Why? The preexisting guest steal time is always added to by
> KVM, so the time won't restart from zero.
>
> Continuing the previous count on CPU hot-unplug followed by hot-plug
> is less obvious, but I think it's overall the right thing to do.
>
> In fact, I was going to test a patch this week as simple as this:
>
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index eea2a6f72b31..1ef5e48b3a36 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -301,8 +301,6 @@ static void kvm_register_steal_time(void)
> if (!has_steal_clock)
> return;
>
> - memset(st, 0, sizeof(*st));
> -
> wrmsrl(MSR_KVM_STEAL_TIME, (slow_virt_to_phys(st) |
> KVM_MSR_ENABLED));
By removing the memset from initial bootup allocation,
can't that cause the steal time to "increase by a ludicrous
amount" the very first time it is compared with the arch
independent value in the scheduler code?
In other words, would removal of the memset result in still
requiring Wanpeng's patch?
What am I overlooking?
Is there something preventing a non-zero value right at
the beginning?
Also, is there a chance of ending up with a non-zero bit
in the seqcount if the memset is removed?
--
All Rights Reversed.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-06-07 1:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 11:57 [PATCH] sched/cputime: add steal clock warps handling during cpu hotplug Wanpeng Li
2016-06-02 12:00 ` Peter Zijlstra
2016-06-02 13:59 ` Rik van Riel
2016-06-03 5:34 ` Wanpeng Li
2016-06-06 13:40 ` Paolo Bonzini
2016-06-06 22:42 ` Wanpeng Li
2016-06-07 1:24 ` Rik van Riel [this message]
2016-06-07 7:31 ` Paolo Bonzini
2016-06-07 7:35 ` Wanpeng Li
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=1465262649.16365.151.camel@redhat.com \
--to=riel@redhat.com \
--cc=fweisbec@gmail.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=wanpeng.li@hotmail.com \
/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