From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQA5k-00014k-DD for qemu-devel@nongnu.org; Fri, 14 Aug 2015 04:11:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQA5h-0002lg-7H for qemu-devel@nongnu.org; Fri, 14 Aug 2015 04:11:56 -0400 Received: from ip-92-43-119-196.beyond.pl ([92.43.119.196]:37596 helo=mx.beyond.pl) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQA5h-0002jG-0t for qemu-devel@nongnu.org; Fri, 14 Aug 2015 04:11:53 -0400 References: <20150813221650.GA8109@amt.cnet> From: =?UTF-8?Q?Marcin_Gibu=c5=82a?= Message-ID: <55CD9968.7000202@beyond.pl> Date: Fri, 14 Aug 2015 09:31:52 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] about the patch kvmclock Ensure proper env->tsc value for kvmclock_current_nsec calculation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: liang.z.li@intel.com W dniu 2015-08-14 o 03:23, Li, Liang Z pisze: >> On Thu, Aug 13, 2015 at 01:25:29AM +0000, Li, Liang Z wrote: >>> Hi Paolo & Marcelo, >>> >>> Could please point out what issue the patch 317b0a6d8ba44e try to fix? I >> found in live migration the cpu_synchronize_all_states will be called twice, >> and it will take more than 1 ms sometimes. I try to do some optimization but >> lack the knowledge about the background. >> >> What the code in 317b0a6d8ba44e requires is to retrieve the TSC value from >> the kernel. > > I know 317b0a6d8ba44e is to retrieve the TSC value, but I don't understand why it is needed. During the live migration, the cpu_synchronize_all_states will be called later after stopping kvm-clock. The env->tsc will be updated, is that not enough? Or is there some case like call the 'stop_vm(RUN_STATE_PAUSED )' or ' 'stop_vm (RUN_STATE_DEBUG) ', that require updating the env->tsc? By google, I find that your patch try to fix some issue, but I don't know what the exact issue. I remember testing these, and I afair that was the reason: http://lists.gnu.org/archive/html/qemu-devel/2014-06/msg00472.html -- mg