From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: About preemption timer Date: Tue, 17 Dec 2013 12:21:32 +0100 Message-ID: <52B033BC.90602@siemens.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini To: Arthur Chunqi Li , kvm Return-path: Received: from goliath.siemens.de ([192.35.17.28]:30776 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972Ab3LQLVh (ORCPT ); Tue, 17 Dec 2013 06:21:37 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 2013-12-17 10:32, Arthur Chunqi Li wrote: > Hi Jan and Paolo, > > I've tried to use preemption timer in KVM to trap vcpu regularly, but > there's something unexpected. I run a VM with 4 vcpus and give them > the same preemption timer value (e.g. 1000000) with all bits set > (activate/save bits), then reset the value in preemption time-out > handler. > > Thus I expected these vcpus trap regularly in some special turns. But > I found that when the VM is not busy, some vcpus are trapped much less > frequently than others. In Intel SDM, I noticed that preemption timer > is only related to TSC, and I think all the vcpus should trap in a > similar frequency. > > Could u help me explain this phenomenon? Are you on a CPU that has non-broken preemption timer support? Anything prior Haswell is known to tick with arbitrary frequencies. BTW, we will have to re-implement preemption timer support with the help of a regular host timer due to the breakage when halting L2 (see my test case). Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux