LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Kele Huang <huangkele@bytedance.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	chaiwen.cc@bytedance.com, xieyongji@bytedance.com,
	dengliang.1214@bytedance.com,
	zhenwei pi <pizhenwei@bytedance.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>, kvm <kvm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] KVM: x86: SVM: don't expose PV_SEND_IPI feature with AVIC
Date: Tue, 16 Nov 2021 10:04:33 +0800	[thread overview]
Message-ID: <CANRm+CxoxaiTcQvm98xs1wmxAhq_u5s-PrkF8Lm2-ovVJeFhuw@mail.gmail.com> (raw)
In-Reply-To: <20211108095931.618865-1-huangkele@bytedance.com>

On Mon, 8 Nov 2021 at 20:48, Kele Huang <huangkele@bytedance.com> wrote:
>
> Currently, AVIC is disabled if x2apic feature is exposed to guest
> or in-kernel PIT is in re-injection mode.
>
> We can enable AVIC with options:
>
>   Kmod args:
>   modprobe kvm_amd avic=1 nested=0 npt=1
>   QEMU args:
>   ... -cpu host,-x2apic -global kvm-pit.lost_tick_policy=discard ...
>
> When LAPIC works in xapic mode, both AVIC and PV_SEND_IPI feature
> can accelerate IPI operations for guest. However, the relationship
> between AVIC and PV_SEND_IPI feature is not sorted out.
>
> In logical, AVIC accelerates most of frequently IPI operations
> without VMM intervention, while the re-hooking of apic->send_IPI_xxx
> from PV_SEND_IPI feature masks out it. People can get confused
> if AVIC is enabled while getting lots of hypercall kvm_exits
> from IPI.
>
> In performance, benchmark tool
> https://lore.kernel.org/kvm/20171219085010.4081-1-ynorov@caviumnetworks.com/
> shows below results:
>
>   Test env:
>   CPU: AMD EPYC 7742 64-Core Processor
>   2 vCPUs pinned 1:1
>   idle=poll
>
>   Test result (average ns per IPI of lots of running):
>   PV_SEND_IPI   : 1860
>   AVIC          : 1390
>
> Besides, disscussions in https://lkml.org/lkml/2021/10/20/423
> do have some solid performance test results to this.
>
> This patch fixes this by masking out PV_SEND_IPI feature when
> AVIC is enabled in setting up of guest vCPUs' CPUID.

This is the second time in community you bytedance guys post patches
w/o evaluating ipi broadcast performance.
https://lore.kernel.org/all/CANRm+Cx597FNRUCyVz1D=B6Vs2GX3Sw57X7Muk+yMpi_hb+v1w@mail.gmail.com/T/#u

    Wanpeng

      parent reply	other threads:[~2021-11-16  5:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08  9:59 Kele Huang
2021-11-08 10:30 ` Paolo Bonzini
2021-11-08 11:08   ` Maxim Levitsky
2021-11-08 11:14     ` zhenwei pi
2021-11-08 11:18       ` Paolo Bonzini
2021-11-16  2:48     ` Wanpeng Li
2021-11-16  2:56       ` zhenwei pi
2021-11-16  9:06         ` Chao Gao
2021-11-16  9:30           ` [External] " 黄科乐
2021-11-16  9:30           ` Wanpeng Li
     [not found]           ` <CAKUug92xp7mU_KB66jGtdYRhgQpgfCm67r+3kMOMdbrGOrTQcA@mail.gmail.com>
2021-11-16 15:57             ` [External] " Sean Christopherson
2021-11-08 10:45 ` Vitaly Kuznetsov
2021-11-16  2:04 ` Wanpeng Li [this message]

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=CANRm+CxoxaiTcQvm98xs1wmxAhq_u5s-PrkF8Lm2-ovVJeFhuw@mail.gmail.com \
    --to=kernellwp@gmail.com \
    --cc=bp@alien8.de \
    --cc=chaiwen.cc@bytedance.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dengliang.1214@bytedance.com \
    --cc=hpa@zytor.com \
    --cc=huangkele@bytedance.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pizhenwei@bytedance.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    --cc=xieyongji@bytedance.com \
    --subject='Re: [RFC] KVM: x86: SVM: don'\''t expose PV_SEND_IPI feature with AVIC' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).