Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2758194imm; Mon, 24 Sep 2018 09:25:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV615uGWTwhaT8dzpdJOp9635mSMy75oJa45afmHziENaPkLdvgHgsps5RAPSMjXN2tPEcPZi X-Received: by 2002:a63:64c2:: with SMTP id y185-v6mr10309368pgb.411.1537806349923; Mon, 24 Sep 2018 09:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537806349; cv=none; d=google.com; s=arc-20160816; b=0KSxc/cMrsmqL8diAFoMN216Jet4cqjfKdxDObJ9ybS6WUPMgQMn8fp73lAV6jB5MD tfx9KjFzgW+yClTHKPSW5lKbCakD1N4xgkj5VypEvDMzUfrhlIIDJ2b5DDdK3KBGUaoB ZwK/3gs3D8254LHEcQl48AkEWglyonrAAS4Qxlp+fugs/B5Hz3GC/jZejTPqw5R3XOIB HcENONhpGxNXACvs33JantSmii1SUNP6diJTeH3tVLLARxKSWeRQn3LpGncbooaRWX4A IzSOZUk/1HAaR5I3rfnRuIa61qTpzQgjRCTyJS4q1Y4e2Q720VOdG3NmXjV+5i5qyXZ2 7FZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=iCG91zU2Halifva6PdVa6F6eB5VdmkuPUFgmvANz0QA=; b=cj5PgLpzqihzZaS8G61x9bBkwd7WsnlcbwVtLPuiZPrPruRb9R/gcCAb5Ypw1M64wf l8ZmDptgEFCuSyXpAvO6YhhfjmgYA27oS2d/kJGiIrIYfeOZ8K1RpkU481SkMhelC0ra BaajJdNbYMBrFlGntKzkqraQVSsjVE5gVqfcsWfkiB7/T/GlDnRxVtaP/Pa0PmfqUPw9 dlZ5FRHtzskA6gZ5rbRW0AtBfToGNNVwTugV9+bxcTjNTwhxIzYYiyWlqnIos9Uf3rwL z0wOGWs9hoWPYhVXZ4Sv40RmmpmP1Y88ewBtmMM1HLkExIGGu0sLz2L3fsXNIFcWI8J5 2leg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34-v6si36482981pla.195.2018.09.24.09.25.33; Mon, 24 Sep 2018 09:25:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732138AbeIXW1h (ORCPT + 99 others); Mon, 24 Sep 2018 18:27:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55320 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729013AbeIXW1h (ORCPT ); Mon, 24 Sep 2018 18:27:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A701A4FCD8; Mon, 24 Sep 2018 16:24:40 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.43.2.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C4E85C220; Mon, 24 Sep 2018 16:24:38 +0000 (UTC) From: Paolo Bonzini To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "Michael Kelley \(EOSG\)" , Wanpeng Li , 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() In-Reply-To: <87r2hs7cco.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> Date: Mon, 24 Sep 2018 18:24:36 +0200 Message-ID: <87zhw62797.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 24 Sep 2018 16:24:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vitaly Kuznetsov writes: > Paolo Bonzini 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. Hi Paolo, could you please clarify what needs to be done to get this merged? In particular, are you OK with my comment above or do we need to do something with it (e.g. get back to the 'logarythmic search' from v2)? In kvm/queue I can see only 'x86/hyper-v: rename ipi_arg_{ex,non_ex} structures' patch from this series applied. Thanks, -- Vitaly