From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rik van Riel Subject: Re: vtime accounting Date: Fri, 24 Mar 2017 10:55:50 -0400 Message-ID: <1490367350.28917.0.camel@redhat.com> References: <20170308105700.GA109453@lvm> <20170313162259.GE18298@potion> <20170314082601.GC1277@cbox> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: Christoffer Dall , Paolo Bonzini , kvm@vger.kernel.org, Marc Zyngier To: Christoffer Dall , Radim =?UTF-8?Q?Kr=C4=8Dm=C3=A1=C5=99?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936164AbdCXOzw (ORCPT ); Fri, 24 Mar 2017 10:55:52 -0400 In-Reply-To: <20170314082601.GC1277@cbox> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2017-03-14 at 09:26 +0100, Christoffer Dall wrote: > On Mon, Mar 13, 2017 at 06:28:16PM +0100, Radim Krčmář wrote: > > 2017-03-08 02:57-0800, Christoffer Dall: > > > Hi Paolo, > > > > > > I'm looking at improving KVM/ARM a bit by calling > > > guest_exit_irqoff > > > before enabling interrupts when coming back from the guest. > > > > > > Unfortunately, this appears to mess up my view of CPU usage using > > > something like htop on the host, because it appears all time is > > > spent > > > inside the kernel. > > > > > > From my analysis, I think this is because we never handle any > > > interrupts > > > before enabling interrupts, where the x86 code does its > > > handle_external_intr, and the result on ARM is that we never > > > increment > > > jiffies before doing the vtime accounting. > > > > (Hm, the counting might be broken on nohz_full then.) > > > > Don't you still have a scheduler tick even with nohz_full and > something > that will eventually update jiffies then? > With nohz_full, the housekeeping CPU will get a timer interrupt every single jiffy, and the jiffies variable will get updated HZ times a second.