From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [qemu patch V4 2/2] kvmclock: reduce kvmclock difference on migration Date: Mon, 12 Dec 2016 17:44:52 -0200 Message-ID: <20161212194451.GA20241@amt.cnet> References: <20161210172148.361793326@redhat.com> <20161210172324.482367805@redhat.com> <20161212180105.GF3808@thinpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, Dr David Alan Gilbert , Paolo Bonzini , Juan Quintela , Radim Krcmar To: Eduardo Habkost Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbcLLTpX (ORCPT ); Mon, 12 Dec 2016 14:45:23 -0500 Content-Disposition: inline In-Reply-To: <20161212180105.GF3808@thinpad.lan.raisama.net> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 12, 2016 at 04:01:05PM -0200, Eduardo Habkost wrote: > On Sat, Dec 10, 2016 at 03:21:50PM -0200, Marcelo Tosatti wrote: > [...] > > static void kvmclock_realize(DeviceState *dev, Error **errp) > > { > > KVMClockState *s = KVM_CLOCK(dev); > > > > + if (kvm_has_adjust_clock_stable()) { > > + s->clock_is_reliable = true; > > + } > > + > > This seems unnecessary, as kvmclock_vm_state_change() makes sure > it is set at the same time as s->clock. Should we just remove it? There is this initialization that goes from ~running -> running which assumes its initialized: static void kvmclock_vm_state_change(void *opaque, int running, RunState state) { KVMClockState *s = opaque; CPUState *cpu; int cap_clock_ctrl = kvm_check_extension(kvm_state, KVM_CAP_KVMCLOCK_CTRL); int ret; if (running) { struct kvm_clock_data data = {}; uint64_t pvclock_via_mem = 0; /* * If the host where s->clock was read did not support reliable * KVM_GET_CLOCK, read kvmclock value from memory. */ if (!s->clock_is_reliable) { pvclock_via_mem = kvmclock_current_nsec(s); }