From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
"Roman Kagan" <rkagan@virtuozzo.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
"Haiyang Zhang" <haiyangz@microsoft.com>,
"Stephen Hemminger" <sthemmin@microsoft.com>,
"Michael Kelley (EOSG)" <Michael.H.Kelley@microsoft.com>,
"Wanpeng Li" <wanpeng.li@hotmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 RESEND 3/5] KVM: x86: hyperv: use get_vcpu_by_vpidx() in kvm_hv_flush_tlb()
Date: Mon, 17 Sep 2018 10:32:55 +0200 [thread overview]
Message-ID: <87r2hs7cco.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <8da03d2a-5405-f363-f081-e4bc46b106e3@redhat.com> (Paolo Bonzini's message of "Fri, 14 Sep 2018 19:33:34 +0200")
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 22/08/2018 12:18, Vitaly Kuznetsov wrote:
>> VP_INDEX almost always matches VCPU id and get_vcpu_by_vpidx() is fast,
>> use it instead of traversing full vCPU list every time.
>
> ... but if it doesn't, the algorithm is now quadratic, isn't i?
Yes,
I even had an implementation with a logarythmic search back in v2 but
we had a discussion with Roman and he convinced me this is an overkill
and not currently required. It seems that with Qemu this is true indeed,
vp_index always matches vcpu is but in case some other userspace decides
to break this unwritten rule users may experience significant slowdown.
--
Vitaly
next prev parent reply other threads:[~2018-09-17 8:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-22 10:18 [PATCH v4 RESEND 0/5] KVM: x86: hyperv: PV IPI support for Windows guests Vitaly Kuznetsov
2018-08-22 10:18 ` [PATCH v4 RESEND 1/5] KVM: x86: hyperv: enforce vp_index < KVM_MAX_VCPUS Vitaly Kuznetsov
2018-09-14 17:34 ` Paolo Bonzini
2018-08-22 10:18 ` [PATCH v4 RESEND 2/5] KVM: x86: hyperv: optimize 'all cpus' case in kvm_hv_flush_tlb() Vitaly Kuznetsov
2018-09-14 17:32 ` Paolo Bonzini
2018-08-22 10:18 ` [PATCH v4 RESEND 3/5] KVM: x86: hyperv: use get_vcpu_by_vpidx() " Vitaly Kuznetsov
2018-09-14 17:33 ` Paolo Bonzini
2018-09-17 8:32 ` Vitaly Kuznetsov [this message]
2018-09-24 16:24 ` Paolo Bonzini
2018-09-24 16:55 ` Paolo Bonzini
2018-09-25 8:57 ` Roman Kagan
2018-09-25 9:29 ` Paolo Bonzini
2018-09-25 10:10 ` Roman Kagan
2018-09-25 11:42 ` Vitaly Kuznetsov
2018-08-22 10:18 ` [PATCH v4 RESEND 4/5] x86/hyper-v: rename ipi_arg_{ex,non_ex} structures Vitaly Kuznetsov
2018-09-14 17:34 ` Paolo Bonzini
2018-08-22 10:18 ` [PATCH v4 RESEND 5/5] KVM: x86: hyperv: implement PV IPI send hypercalls Vitaly Kuznetsov
2018-08-23 15:56 ` Roman Kagan
2018-08-23 16:16 ` Vitaly Kuznetsov
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=87r2hs7cco.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=Michael.H.Kelley@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kvm@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkagan@virtuozzo.com \
--cc=rkrcmar@redhat.com \
--cc=sthemmin@microsoft.com \
--cc=wanpeng.li@hotmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox