Messages in this thread | | | From | Wanpeng Li <> | Date | Wed, 19 Feb 2020 08:47:56 +0800 | Subject | Re: [PATCH] KVM: LAPIC: Recalculate apic map in batch |
| |
On Tue, 18 Feb 2020 at 20:24, Vitaly Kuznetsov <vkuznets@redhat.com> wrote: > > Wanpeng Li <kernellwp@gmail.com> writes: > > > From: Wanpeng Li <wanpengli@tencent.com> > > > > In the vCPU reset and set APIC_BASE MSR path, the apic map will be recalculated > > several times, each time it will consume 10+ us observed by ftrace in my > > non-overcommit environment since the expensive memory allocate/mutex/rcu etc > > operations. This patch optimizes it by recaluating apic map in batch, I hope > > this can benefit the serverless scenario which can frequently create/destroy > > VMs. > > > > Signed-off-by: Wanpeng Li <wanpengli@tencent.com> > > An alternative idea: instead of making every caller return bool and > every call site handle the result (once) just add a > KVM_REQ_APIC_MAP_RECALC flag or a boolean flag to struct kvm. I > understand it may not be that easy as it sounds as we may be conunting > on valid mapping somewhere before we actually get to handiling
Yes.
> KVM_REQ_APIC_MAP_RECALC but we may preserve *some* > recalculate_apic_map() calls (and make it reset KVM_REQ_APIC_MAP_RECALC).
Paolo, keep the caller return bool or add a booleen flag to struct kvm, what do you think?
Wanpeng
| |