From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH v4 RESEND 3/5] KVM: x86: hyperv: use get_vcpu_by_vpidx() in kvm_hv_flush_tlb() Date: Tue, 25 Sep 2018 13:42:18 +0200 Message-ID: <871s9hreg5.fsf@vitty.brq.redhat.com> References: <20180822101832.31763-1-vkuznets@redhat.com> <20180822101832.31763-4-vkuznets@redhat.com> <8da03d2a-5405-f363-f081-e4bc46b106e3@redhat.com> <87r2hs7cco.fsf@vitty.brq.redhat.com> <87zhw62797.fsf@vitty.brq.redhat.com> <74055c3b-be66-4ce6-e727-a155f18a0ba1@redhat.com> <20180925085752.GA5391@rkaganb.sw.ru> <20180925101040.GA2336@rkaganb.sw.ru> Mime-Version: 1.0 Content-Type: text/plain Cc: kvm@vger.kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley \(EOSG\)" , Wanpeng Li , linux-kernel@vger.kernel.org To: Roman Kagan , Paolo Bonzini Return-path: In-Reply-To: <20180925101040.GA2336@rkaganb.sw.ru> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Roman Kagan writes: > On Tue, Sep 25, 2018 at 11:29:57AM +0200, Paolo Bonzini wrote: >> On 25/09/2018 10:57, Roman Kagan wrote: >> > If we can assume that in all relevant cases vp_index coincides with the >> > cpu index (which I think we can) then Vitaly's approach is the most >> > efficient. >> > >> > If, on the opposite, we want to optimize for random mapping between >> > vp_index and cpu index, then it's probably better instead to iterate >> > over vcpus and test if their vp_index belongs to the requested mask. >> >> Yes, that would work too. Perhaps we can do both? You can have a >> kvm->num_mismatched_vp_indexes count to choose between the two. > > Makes sense to me. Thanks guys, I'll try to draft something up for v6. -- Vitaly