[PATCH v2 5/6] kvm: allocate vcpu pointer array separately
Sean Christopherson
seanjc at google.com
Thu Sep 9 13:28:10 PDT 2021
On Mon, Sep 06, 2021, Marc Zyngier wrote:
> On Mon, 06 Sep 2021 05:33:35 +0100,
> Juergen Gross <jgross at suse.com> wrote:
> >
> > On 03.09.21 16:41, Marc Zyngier wrote:
> >
> > > At this stage, I really wonder why we are not using an xarray instead.
> > >
> > > I wrote this [1] a while ago, and nothing caught fire. It was also a
> > > net deletion of code...
> >
> > Indeed, I'd prefer that solution!
> >
> > Are you fine with me swapping my patch with yours in the series?
>
> Of course, feel free to grab the whole series. You'll probably need
> the initial patches to set the scene for this. On their own, they are
> a nice cleanup, and I trust you can write a decent commit message for
> the three patches affecting mips/s390/x86.
It would also be a good idea to convert kvm_for_each_vcpu() to use xa_for_each(),
I assume that's more performant than 2x atomic_read() + xa_load(). Unless I'm
misreading the code, xa_for_each() is guaranteed to iterate in ascending index
order, i.e. preserves the current vcpu0..vcpuN iteration order.
More information about the linux-arm-kernel
mailing list