From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v2 4/6] KVM-GST: KVM Steal time registration Date: Tue, 01 Feb 2011 17:17:10 +0100 Message-ID: <1296577030.26581.236.camel@laptop> References: <1296244340-15173-1-git-send-email-glommer@redhat.com> <1296244340-15173-5-git-send-email-glommer@redhat.com> <4D45649A.4090709@redhat.com> <1296575618.5081.13.camel@mothafucka.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, aliguori@us.ibm.com, Rik van Riel , Jeremy Fitzhardinge , Venkatesh Pallipadi To: Glauber Costa Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:46610 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751765Ab1BAQQR (ORCPT ); Tue, 1 Feb 2011 11:16:17 -0500 Received: from canuck.infradead.org ([134.117.69.58]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1PkItt-0006Gw-7T for kvm@vger.kernel.org; Tue, 01 Feb 2011 16:16:17 +0000 Received: from j77219.upc-j.chello.nl ([24.132.77.219] helo=dyad.programming.kicks-ass.net) by canuck.infradead.org with esmtpsa (Exim 4.72 #1 (Red Hat Linux)) id 1PkIts-0007Aa-NC for kvm@vger.kernel.org; Tue, 01 Feb 2011 16:16:16 +0000 In-Reply-To: <1296575618.5081.13.camel@mothafucka.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2011-02-01 at 13:53 -0200, Glauber Costa wrote: > > And since the granularity of the cpu accounting is too coarse, we end up > with much more steal time than we should, because things that are less > than 1 unity of cputime, are often rounded up to 1 unity of cputime. See, that! is the problem, don't round up like that. What you can do is: steal_ticks = steal_time_clock() / TICK_NSEC, or simply keep a steal time delta and every time it overflows cputime_one_jiffy insert a steal-time tick. Venki might have created some infrastructure for doing this with the IRQ_TIME accounting mess, but irqtime_account_process_tick() still gives me a head-ache.