On Wed, 10 Mar 2021 16:03:42 +0000,
Paolo Bonzini <[email protected]> wrote:
> 
> On 10/03/21 16:51, Marc Zyngier wrote:
> >> +  kvm_for_each_vcpu(j, vcpu, kvm) {
> >> +          pdata = data + VM_STAT_COUNT;
> >> +          for (i = 0; i < VCPU_STAT_COUNT; i++, pdata++)
> >> +                  *pdata += *((u64 *)&vcpu->stat + i);
> > Do you really need the in-kernel copy? Why not directly organise the
> > data structures in a way that would allow a bulk copy using
> > copy_to_user()?
> 
> The result is built by summing per-vCPU counters, so that the counter
> updates are fast and do not require a lock.  So consistency basically
> cannot be guaranteed.

Sure, but I wonder whether there is scope for VM-global counters to be
maintained in parallel with per-vCPU counters if speed/efficiency is
of the essence (and this seems to be how it is sold in the cover
letter).

Thanks,

        M.

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to