From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Date: Wed, 13 Jul 2016 18:00:54 +0000 Subject: Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics Message-Id: <578681D6.8070801@de.ibm.com> List-Id: References: <1468220912-22828-1-git-send-email-sjitindarsingh@gmail.com> <1468220912-22828-4-git-send-email-sjitindarsingh@gmail.com> <9253603f-fbfb-09f1-9576-9291d1587397@redhat.com> <353f05d6-74a2-69c0-978d-7c3df6b33755@redhat.com> In-Reply-To: <353f05d6-74a2-69c0-978d-7c3df6b33755@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paolo Bonzini , David Matlack Cc: kvm list , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , kvm-ppc@vger.kernel.org, paulus@samba.org, Suraj Jitindar Singh , linuxppc-dev@lists.ozlabs.org, agraf@suse.com On 07/11/2016 09:31 PM, Paolo Bonzini wrote: > > > On 11/07/2016 19:30, David Matlack wrote: >> On Mon, Jul 11, 2016 at 10:05 AM, Paolo Bonzini wrote: >>> >>> >>> On 11/07/2016 18:51, David Matlack wrote: >>>>>> vcpus have statistics associated with them which can be viewed within the >>>>>> debugfs. Currently it is assumed within the vcpu_stat_get() and >>>>>> vcpu_stat_get_per_vm() functions that all of these statistics are >>>>>> represented as 32-bit numbers. The next patch adds some 64-bit statistics, >>>>>> so add provisioning for the display of 64-bit vcpu statistics. >>>> Thanks, we need 64-bit stats in other places as well. Can we use this >>>> opportunity to wholesale upgrade all KVM stats from u32 to u64? Most >>>> of this patch is duplicated code with "u32" swapped with "u64". >>>> >>> >>> I'm not sure of what 32-bit architectures would do, but perhaps we could >>> upgrade them to unsigned long at least. >> >> I thought u64 still existed on 32-bit architectures. unsigned long >> would be fine but with the caveat that certain stats would overflow on >> 32-bit architectures. > > Yes, but not all 32-bit architectures can do atomic read-modify-write > (e.g. add) operations on 64-bit values. So what about only doing it for the VCPU events? Those should be only modified by one CPU. We would have some odd values on 32bit overflow, but this will be certainly better than just start with 0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rqRTc3gdbzDqGw for ; Thu, 14 Jul 2016 04:01:08 +1000 (AEST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6DHxu2Y108082 for ; Wed, 13 Jul 2016 14:01:05 -0400 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0a-001b2d01.pphosted.com with ESMTP id 245hgaw8yy-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 13 Jul 2016 14:01:02 -0400 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jul 2016 19:01:01 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4F3172190046 for ; Wed, 13 Jul 2016 19:00:27 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6DI0wbQ15270378 for ; Wed, 13 Jul 2016 18:00:59 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6DI0whl002993 for ; Wed, 13 Jul 2016 12:00:58 -0600 Subject: Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics To: Paolo Bonzini , David Matlack References: <1468220912-22828-1-git-send-email-sjitindarsingh@gmail.com> <1468220912-22828-4-git-send-email-sjitindarsingh@gmail.com> <9253603f-fbfb-09f1-9576-9291d1587397@redhat.com> <353f05d6-74a2-69c0-978d-7c3df6b33755@redhat.com> Cc: Suraj Jitindar Singh , linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org, mpe@ellerman.id.au, paulus@samba.org, benh@kernel.crashing.org, kvm list , agraf@suse.com, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= From: Christian Borntraeger Date: Wed, 13 Jul 2016 20:00:54 +0200 MIME-Version: 1.0 In-Reply-To: <353f05d6-74a2-69c0-978d-7c3df6b33755@redhat.com> Content-Type: text/plain; charset=utf-8 Message-Id: <578681D6.8070801@de.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 07/11/2016 09:31 PM, Paolo Bonzini wrote: > > > On 11/07/2016 19:30, David Matlack wrote: >> On Mon, Jul 11, 2016 at 10:05 AM, Paolo Bonzini wrote: >>> >>> >>> On 11/07/2016 18:51, David Matlack wrote: >>>>>> vcpus have statistics associated with them which can be viewed within the >>>>>> debugfs. Currently it is assumed within the vcpu_stat_get() and >>>>>> vcpu_stat_get_per_vm() functions that all of these statistics are >>>>>> represented as 32-bit numbers. The next patch adds some 64-bit statistics, >>>>>> so add provisioning for the display of 64-bit vcpu statistics. >>>> Thanks, we need 64-bit stats in other places as well. Can we use this >>>> opportunity to wholesale upgrade all KVM stats from u32 to u64? Most >>>> of this patch is duplicated code with "u32" swapped with "u64". >>>> >>> >>> I'm not sure of what 32-bit architectures would do, but perhaps we could >>> upgrade them to unsigned long at least. >> >> I thought u64 still existed on 32-bit architectures. unsigned long >> would be fine but with the caveat that certain stats would overflow on >> 32-bit architectures. > > Yes, but not all 32-bit architectures can do atomic read-modify-write > (e.g. add) operations on 64-bit values. So what about only doing it for the VCPU events? Those should be only modified by one CPU. We would have some odd values on 32bit overflow, but this will be certainly better than just start with 0 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics Date: Wed, 13 Jul 2016 20:00:54 +0200 Message-ID: <578681D6.8070801@de.ibm.com> References: <1468220912-22828-1-git-send-email-sjitindarsingh@gmail.com> <1468220912-22828-4-git-send-email-sjitindarsingh@gmail.com> <9253603f-fbfb-09f1-9576-9291d1587397@redhat.com> <353f05d6-74a2-69c0-978d-7c3df6b33755@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: kvm list , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , kvm-ppc@vger.kernel.org, paulus@samba.org, Suraj Jitindar Singh , linuxppc-dev@lists.ozlabs.org, agraf@suse.com To: Paolo Bonzini , David Matlack Return-path: In-Reply-To: <353f05d6-74a2-69c0-978d-7c3df6b33755@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" List-Id: kvm.vger.kernel.org T24gMDcvMTEvMjAxNiAwOTozMSBQTSwgUGFvbG8gQm9uemluaSB3cm90ZToKPiAKPiAKPiBPbiAx MS8wNy8yMDE2IDE5OjMwLCBEYXZpZCBNYXRsYWNrIHdyb3RlOgo+PiBPbiBNb24sIEp1bCAxMSwg MjAxNiBhdCAxMDowNSBBTSwgUGFvbG8gQm9uemluaSA8cGJvbnppbmlAcmVkaGF0LmNvbT4gd3Jv dGU6Cj4+Pgo+Pj4KPj4+IE9uIDExLzA3LzIwMTYgMTg6NTEsIERhdmlkIE1hdGxhY2sgd3JvdGU6 Cj4+Pj4+PiB2Y3B1cyBoYXZlIHN0YXRpc3RpY3MgYXNzb2NpYXRlZCB3aXRoIHRoZW0gd2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