All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
To: David Matlack <dmatlack@google.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
	mpe@ellerman.id.au, paulus@samba.org, benh@kernel.crashing.org,
	"kvm list" <kvm@vger.kernel.org>,
	agraf@suse.com, "Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics
Date: Tue, 12 Jul 2016 06:24:47 +0000	[thread overview]
Message-ID: <57848D2F.4000502@gmail.com> (raw)
In-Reply-To: <CALzav=dKq4GLcQQ8wQm9iNSbQPYK64224aAtz0ve06KPvSfUww@mail.gmail.com>



On 12/07/16 05:45, David Matlack wrote:
> On Mon, Jul 11, 2016 at 12:31 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 11/07/2016 19:30, David Matlack wrote:
>>> On Mon, Jul 11, 2016 at 10:05 AM, Paolo Bonzini <pbonzini@redhat.com> 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.
> I think that's ok, none of the stats currently use atomic operations.

Yeah so this patch pretty much duplicates the 32-bit code.

So what you're saying is just replace all of the 32-bit statistics with
longs, that way we get 32-bit on 32-bit machines and 64-bit on 64-bit
machines? Then we just accept that on 32-bit machines we will get overflow
on some stats.

Or do you think u64s would be better and we accept that on 32-bit machines
we might get update conflicts from non-atomic concurrent accesses? Which
honestly I don't see being a huge issue in this use case.

>
>> Paolo


WARNING: multiple messages have this Message-ID (diff)
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
To: David Matlack <dmatlack@google.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
	mpe@ellerman.id.au, paulus@samba.org, benh@kernel.crashing.org,
	"kvm list" <kvm@vger.kernel.org>,
	agraf@suse.com, "Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics
Date: Tue, 12 Jul 2016 16:24:47 +1000	[thread overview]
Message-ID: <57848D2F.4000502@gmail.com> (raw)
In-Reply-To: <CALzav=dKq4GLcQQ8wQm9iNSbQPYK64224aAtz0ve06KPvSfUww@mail.gmail.com>



On 12/07/16 05:45, David Matlack wrote:
> On Mon, Jul 11, 2016 at 12:31 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 11/07/2016 19:30, David Matlack wrote:
>>> On Mon, Jul 11, 2016 at 10:05 AM, Paolo Bonzini <pbonzini@redhat.com> 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.
> I think that's ok, none of the stats currently use atomic operations.

Yeah so this patch pretty much duplicates the 32-bit code.

So what you're saying is just replace all of the 32-bit statistics with
longs, that way we get 32-bit on 32-bit machines and 64-bit on 64-bit
machines? Then we just accept that on 32-bit machines we will get overflow
on some stats.

Or do you think u64s would be better and we accept that on 32-bit machines
we might get update conflicts from non-atomic concurrent accesses? Which
honestly I don't see being a huge issue in this use case.

>
>> Paolo

  reply	other threads:[~2016-07-12  6:24 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11  7:08 [PATCH V2 1/5] kvm/ppc/book3s: Move struct kvmppc_vcore from kvm_host.h to kvm_book3s.h Suraj Jitindar Singh
2016-07-11  7:08 ` Suraj Jitindar Singh
2016-07-11  7:08 ` [PATCH V2 2/5] kvm/ppc/book3s_hv: Change vcore element runnable_threads from linked-list to array Suraj Jitindar Singh
2016-07-11  7:08   ` Suraj Jitindar Singh
2016-07-11  7:08 ` [PATCH V2 3/5] kvm/ppc/book3s_hv: Implement halt polling in the kvm_hv kernel module Suraj Jitindar Singh
2016-07-11  7:08   ` Suraj Jitindar Singh
2016-07-11 16:57   ` David Matlack
2016-07-11 16:57     ` David Matlack
2016-07-11 17:07     ` Paolo Bonzini
2016-07-11 17:07       ` Paolo Bonzini
2016-07-11 17:26       ` David Matlack
2016-07-11 17:26         ` David Matlack
2016-07-12  6:33         ` Suraj Jitindar Singh
2016-07-12  6:33           ` Suraj Jitindar Singh
2016-07-11  7:08 ` [PATCH V2 4/5] kvm/stats: Add provisioning for 64-bit vcpu statistics Suraj Jitindar Singh
2016-07-11  7:08   ` Suraj Jitindar Singh
2016-07-11 16:51   ` David Matlack
2016-07-11 16:51     ` David Matlack
2016-07-11 17:05     ` Paolo Bonzini
2016-07-11 17:05       ` Paolo Bonzini
2016-07-11 17:30       ` David Matlack
2016-07-11 17:30         ` David Matlack
2016-07-11 19:31         ` Paolo Bonzini
2016-07-11 19:31           ` Paolo Bonzini
2016-07-11 19:45           ` David Matlack
2016-07-11 19:45             ` David Matlack
2016-07-12  6:24             ` Suraj Jitindar Singh [this message]
2016-07-12  6:24               ` Suraj Jitindar Singh
2016-07-13 18:00           ` Christian Borntraeger
2016-07-13 18:00             ` Christian Borntraeger
2016-07-13 18:00             ` Christian Borntraeger
2016-07-14  9:42             ` Paolo Bonzini
2016-07-14  9:42               ` Paolo Bonzini
2016-07-15  7:52               ` Suraj Jitindar Singh
2016-07-15  7:52                 ` Suraj Jitindar Singh
2016-07-18  7:17                 ` Christian Borntraeger
2016-07-18  7:17                   ` Christian Borntraeger
2016-07-18  8:24                   ` Paolo Bonzini
2016-07-18  8:24                     ` Paolo Bonzini
2016-07-19  1:31                     ` Suraj Jitindar Singh
2016-07-19  1:31                       ` Suraj Jitindar Singh
2016-07-11  7:08 ` [PATCH V2 5/5] powerpc/kvm/stats: Implement existing and add new halt polling vcpu stats Suraj Jitindar Singh
2016-07-11  7:08   ` Suraj Jitindar Singh
2016-07-11 16:49   ` David Matlack
2016-07-11 16:49     ` David Matlack
2016-07-12  6:17     ` Suraj Jitindar Singh
2016-07-12  6:17       ` Suraj Jitindar Singh
2016-07-13  6:07       ` Suraj Jitindar Singh
2016-07-13  6:07         ` Suraj Jitindar Singh
2016-07-13 17:20         ` David Matlack
2016-07-13 17:20           ` David Matlack
2016-07-15  7:53           ` Suraj Jitindar Singh
2016-07-15  7:53             ` Suraj Jitindar Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57848D2F.4000502@gmail.com \
    --to=sjitindarsingh@gmail.com \
    --cc=agraf@suse.com \
    --cc=benh@kernel.crashing.org \
    --cc=dmatlack@google.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.