lkml.org 
[lkml]   [2020]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2020-02-19 01:49    [W:0.078 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site