Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757895AbcCCSgL (ORCPT ); Thu, 3 Mar 2016 13:36:11 -0500 Received: from mail5.windriver.com ([192.103.53.11]:57182 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757425AbcCCSgH (ORCPT ); Thu, 3 Mar 2016 13:36:07 -0500 Message-ID: <56D88412.7010101@windriver.com> Date: Thu, 3 Mar 2016 12:36:02 -0600 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: lkml , Frederic Weisbecker Subject: Re: weird /proc/stat output with newer (4.1, 4.2) kernels in kvm guest on 3.10 host? References: <56D71EF1.2090404@windriver.com> In-Reply-To: <56D71EF1.2090404@windriver.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.25.39.6] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1353 Lines: 40 On 03/02/2016 11:12 AM, Chris Friesen wrote: > I'm running a 3.10-based host with libvirt 1.2.12 and qemu 2.2. > > Running a Fedora23 cloud image as a guest, the "cpu" lines in /proc/stat seem to > be hardly changing: > > [fedora@fedora23 boot]$ uptime > 17:01:50 up 44 min, 1 user, load average: 3.00, 2.99, 2.79 > [fedora@fedora23 boot]$ grep cpu /proc/stat > cpu 13 0 124 65880 165 0 0 23088 0 0 > cpu0 1 0 4 21967 67 0 0 21866 0 0 > cpu1 8 0 52 21877 66 0 0 623 0 0 > cpu2 4 0 67 22034 30 0 0 598 0 0 > > > Running an Ubuntu 15.10 cloud image as a guest, everything looks fine: > > ubuntu@ubuntu1510:/boot$ uptime > 17:02:28 up 28 min, 1 user, load average: 3.00, 2.98, 2.42 > ubuntu@ubuntu1510:/boot$ grep cpu /proc/stat > cpu 3932 130 443061 46116 257 0 5 12974 0 0 > cpu0 1296 130 139886 14960 195 0 1 12343 0 0 > cpu1 1330 0 151580 15570 35 0 0 315 0 0 > cpu2 1305 0 151595 15586 26 0 4 316 0 0 > > > In both cases the current_clocksource is kvm-clock. Quick update (sorry it's not threaded, I'm not subscribed to the list). The problem seems to be related to VIRT_CPU_ACCOUNTING being enabled in the guest. If I switch to TICK_CPU_ACCOUNTING or IRQ_TIME_ACCOUNTING then the problem goes away. I'm digging into the code now. Anyone have any tips on debugging why VIRT_CPU_ACCOUNTING is misbehaving in the guest? Thanks, Chris