Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5332636ybi; Wed, 12 Jun 2019 00:23:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpSlHk49gbLcGx9DGnYKNoygdydanR+HxXcfmUbz1HE5DCdX0m8U2L+iT/ZRgts51V5qGL X-Received: by 2002:a65:41c6:: with SMTP id b6mr23405915pgq.399.1560324194500; Wed, 12 Jun 2019 00:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560324194; cv=none; d=google.com; s=arc-20160816; b=soy9/ft7L/Jp32p7VFvuceH6tSpkVQ1t0/jHwf6tFnRIHPJ1cR5KbO1f3l63Wm78Hx rzi/Wq9Q0R6fF6chNeNruzBRKNXRj/L8OhGtKEbLMKpK6dOV4cahtnX+xrkTaEv/Wtpu M4k6njofASePvlj/gOeywbq5SlIZwulBvXp2/JO1K3twiYjsmspRr5y9743HO0dRKpkX /LJpNUfGsg1R6H5sNkPl9Qr5HadfXWGl7wiYBCVz4hMFbmStPw6BTVnUB6RK8J11EBT4 rn3X2dIGvypm1yj0zZlFg1sANRLZNVFmNLTCDe0iTjoK2YhOuByVqqoo9uq0p/Ku23YH Gpdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=ydXYegSsk8MFFAKGT3kHy7pToynlZlXFgT5BPbWFhEQ=; b=LfUyD2n3N2+dSSFHxx/TCuyFLwpeb3kkGPEz+6ppdwMSt5NFUMylhR36mVRjG4zRr1 Vca0kt9l9/3WVtaUf4CHZyJbXiWlyB93WRuWM/z/OrYpv3GFujjcEFf7rg1u+JEBlPN1 jwG1Dw/BHG6CjoOPH99OAxUCOoqwmjiV2BFzcwUulON/jtcOtAGNJE8xrRMC1qMV7JfP pZpwjlWbHTm5cpmr6nI7Va1X13xRr6TMh8t1KMlQi6n8tftUr8Ri34GIoI3A1gcEipbq dVSmsNFGCn+QNuTcl6LNjsbaz0/NDkF/QyzOh0ZGBKtrBSYnyvIt+ez37xQ5Rcn05ey3 kZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="s/iyRl96"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 27si487002pgt.241.2019.06.12.00.22.54; Wed, 12 Jun 2019 00:23:14 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="s/iyRl96"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406951AbfFLBhk (ORCPT + 99 others); Tue, 11 Jun 2019 21:37:40 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46177 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406864AbfFLBhk (ORCPT ); Tue, 11 Jun 2019 21:37:40 -0400 Received: by mail-pf1-f195.google.com with SMTP id 81so8564615pfy.13; Tue, 11 Jun 2019 18:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ydXYegSsk8MFFAKGT3kHy7pToynlZlXFgT5BPbWFhEQ=; b=s/iyRl96wWweA0Dc+5vAJ04IgU/jkPqkjOPULxvdeFHMVp6+SB0nh0w7OEkUFKp5V9 CqWPNijp6hAD9M0TU74Rrz1tAsA3MYm0idF5PRpTN6YzUbknOYuU9pCqixCNJMiAMFx2 HpS7UHaD3C26iyKheZHbsi1lntzlpMnsft/RNpXtAoLrmTzeyvYsr7Ve5UtA+AXsdUJf n1pQllp1zPXVv3t7nzx2mzJfutm1ku3/Gepa8oHqqZCSRXgoA6lIVF6VUE7YGLomaqvh 68YM/aNYOK84mKzQr3ymkmguwqzd10bLmFwL/5P4MYqY3epnD2kC1tB3jOWIiNR5u4xL opGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ydXYegSsk8MFFAKGT3kHy7pToynlZlXFgT5BPbWFhEQ=; b=YtBWAeqGEQK2rKnZxzyA9nmcveyWKPadyiDjghomyGDOW9pX0sQKLPuEaXfroQHc5c WRP/Y92kzr+T6x39CrfmYE87z90xpCW9u7F98r/ydEwLETFjzyxWUBhJbPwd+BNKiMby xHmcgpo2cKOkPvDJn5oAChL0w2IljdP4aNEU3vm8yaVXB54Eqgml1lZXMhWBmrbcj8KD qTZtOkpZudax1B5kTo8OYmuX8B7FrFL72FjbJbYb/TWj8bDwsMBGx5i16VtXWjUJyi3+ ql3Sh36WrzEpysqsG23osYEjoVjpf2ltBE/pV0+Dchh4nWxXBAcul2PRVU2bfM+LT8St 1NMg== X-Gm-Message-State: APjAAAUqDN7uHU+JqfYiqndfmwk/MY/3w3ODVR+ee3KHqEEGRaVrUr34 EdOxpCyLL6H2oFi092PSgsI= X-Received: by 2002:a63:b1d:: with SMTP id 29mr22800685pgl.103.1560303459071; Tue, 11 Jun 2019 18:37:39 -0700 (PDT) Received: from [10.2.189.129] ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id a16sm26653148pfd.68.2019.06.11.18.37.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 18:37:38 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v3 0/3] KVM: Yield to IPI target if necessary From: Nadav Amit In-Reply-To: Date: Tue, 11 Jun 2019 18:37:36 -0700 Cc: Sean Christopherson , =?utf-8?B?UmFkaW0gS3LEjW3DocWZ?= , LKML , kvm , Paolo Bonzini Content-Transfer-Encoding: quoted-printable Message-Id: <28BF5471-57E8-41FE-B401-D49D57D01A63@gmail.com> References: <1559178307-6835-1-git-send-email-wanpengli@tencent.com> <20190610143420.GA6594@flask> <20190611011100.GB24835@linux.intel.com> <153047ED-75E2-4E70-BC33-C5FF27C08638@gmail.com> To: Wanpeng Li X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 11, 2019, at 6:18 PM, Wanpeng Li wrote: >=20 > On Wed, 12 Jun 2019 at 00:57, Nadav Amit wrote: >>> On Jun 11, 2019, at 3:02 AM, Wanpeng Li wrote: >>>=20 >>> On Tue, 11 Jun 2019 at 09:48, Nadav Amit = wrote: >>>>> On Jun 10, 2019, at 6:45 PM, Wanpeng Li = wrote: >>>>>=20 >>>>> On Tue, 11 Jun 2019 at 09:11, Sean Christopherson >>>>> wrote: >>>>>> On Mon, Jun 10, 2019 at 04:34:20PM +0200, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: >>>>>>> 2019-05-30 09:05+0800, Wanpeng Li: >>>>>>>> The idea is from Xen, when sending a call-function IPI-many to = vCPUs, >>>>>>>> yield if any of the IPI target vCPUs was preempted. 17% = performance >>>>>>>> increasement of ebizzy benchmark can be observed in an = over-subscribe >>>>>>>> environment. (w/ kvm-pv-tlb disabled, testing TLB flush = call-function >>>>>>>> IPI-many since call-function is not easy to be trigged by = userspace >>>>>>>> workload). >>>>>>>=20 >>>>>>> Have you checked if we could gain performance by having the = yield as an >>>>>>> extension to our PV IPI call? >>>>>>>=20 >>>>>>> It would allow us to skip the VM entry/exit overhead on the = caller. >>>>>>> (The benefit of that might be negligible and it also poses a >>>>>>> complication when splitting the target mask into several PV IPI >>>>>>> hypercalls.) >>>>>>=20 >>>>>> Tangetially related to splitting PV IPI hypercalls, are there any = major >>>>>> hurdles to supporting shorthand? Not having to generate the mask = for >>>>>> ->send_IPI_allbutself and ->kvm_send_ipi_all seems like an easy = to way >>>>>> shave cycles for affected flows. >>>>>=20 >>>>> Not sure why shorthand is not used for native x2apic mode. >>>>=20 >>>> Why do you say so? native_send_call_func_ipi() checks if allbutself >>>> shorthand should be used and does so (even though the check can be = more >>>> efficient - I=E2=80=99m looking at that code right now=E2=80=A6) >>>=20 >>> Please continue to follow the apic/x2apic driver. Just apic_flat set >>> APIC_DEST_ALLBUT/APIC_DEST_ALLINC to ICR. >>=20 >> Indeed - I was sure by the name that it does it correctly. That=E2=80=99= s stupid. >>=20 >> I=E2=80=99ll add it to the patch-set I am working on (TLB shootdown = improvements), >> if you don=E2=80=99t mind. >=20 > Original for hotplug cpu safe. > https://lwn.net/Articles/138365/ > https://lwn.net/Articles/138368/ > Not sure shortcut native support is acceptable, I will play my > kvm_send_ipi_allbutself and kvm_send_ipi_all. :) Yes, I saw these threads before. But I think the test in native_send_call_func_ipi() should take care of it. I=E2=80=99ll recheck.=