linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rik van Riel <riel@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm <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: Tue, 7 Jun 2016 06:42:39 +0800	[thread overview]
Message-ID: <CANRm+CyT=BtrBtNXJHThWKnzc4tzO1-dPeGX3S8cKtZTc3Phig@mail.gmail.com> (raw)
In-Reply-To: <b17566fa-1943-3bda-28f3-f6e21a424d9c@redhat.com>

2016-06-06 21:40 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
>
>
> 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));
>         pr_info("kvm-stealtime: cpu %d, msr %llx\n",
>                 cpu, (unsigned long long) slow_virt_to_phys(st));

Thanks for the suggestion, I will try it today.

Regards,
Wanpeng Li

  reply	other threads:[~2016-06-06 22:42 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 [this message]
2016-06-07  1:24       ` Rik van Riel
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='CANRm+CyT=BtrBtNXJHThWKnzc4tzO1-dPeGX3S8cKtZTc3Phig@mail.gmail.com' \
    --to=kernellwp@gmail.com \
    --cc=fweisbec@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=riel@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).