From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Date: Tue, 19 Jul 2016 08:52:39 +0000 Subject: Re: [PATCH V4 4/5] kvm/stats: Add provisioning for ulong vm stats and u64 vcpu stats Message-Id: <578DEA57.70002@de.ibm.com> List-Id: References: <1468915977-26929-1-git-send-email-sjitindarsingh@gmail.com> <1468915977-26929-4-git-send-email-sjitindarsingh@gmail.com> In-Reply-To: <1468915977-26929-4-git-send-email-sjitindarsingh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Suraj Jitindar Singh , linuxppc-dev@lists.ozlabs.org Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, mpe@ellerman.id.au, paulus@samba.org, benh@kernel.crashing.org, pbonzini@redhat.com, agraf@suse.com, rkrcmar@redhat.com, dmatlack@google.com On 07/19/2016 10:12 AM, Suraj Jitindar Singh wrote: > vms and vcpus have statistics associated with them which can be viewed > within the debugfs. Currently it is assumed within the vcpu_stat_get() and > vm_stat_get() functions that all of these statistics are represented as > u32s, however the next patch adds some u64 vcpu statistics. > > Change all vcpu statistics to u64 and modify vcpu_stat_get() accordingly. > Since vcpu statistics are per vcpu, they will only be updated by a single > vcpu at a time so this shouldn't present a problem on 32-bit machines > which can't atomically increment 64-bit numbers. However vm statistics > could potentially be updated by multiple vcpus from that vm at a time. > To avoid the overhead of atomics make all vm statistics ulong such that > they are 64-bit on 64-bit systems where they can be atomically incremented > and are 32-bit on 32-bit systems which may not be able to atomically > increment 64-bit numbers. Modify vm_stat_get() to expect ulongs. > > Signed-off-by: Suraj Jitindar Singh Acked-by: Christian Borntraeger