Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4652767ybi; Tue, 11 Jun 2019 10:08:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxM1s0Z4l6VK1eTIvOgQ01h+Q6p6ru0TzDvWW2lpFjRfaj885TlQBkns2iofM3IXZ1bXHHb X-Received: by 2002:a62:87c5:: with SMTP id i188mr24631621pfe.118.1560272887372; Tue, 11 Jun 2019 10:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560272887; cv=none; d=google.com; s=arc-20160816; b=jUzBUqSnyZqn3XYM1b3g2NfM6r16PZRWgDUykmp4xAFID/DxfYmLG+rBZu/HMId0Rt ZKnnhHBX3p4hGRaowL7Dn7zSuik2X0ynAYryF42zRilcJxbbYzZv0p6NExzJ6kDyM+6O kJTQubjunH8mxhQFANwkqB/IHa0x1uzYfFeib63ONVMCFcWFtLg8v1jYqsl9B90y1GEj 5TjfNzn+hJ0GiFpQU88jDH4mxgjgZEyiNHXrWp1dNhw20g5cuCydNSeJPZHyjk0XX6Cz ip/golNlhWVdD75ZnefmALulzx1MpqQKvVzfZpXMhfGwjTqxrN/esu2Igo4hO/9m66TA TM5A== 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=LRf7jr0/HLf72a+GCXiXIigk1cbBqM+c/XCEYVEbVfg=; b=OLnOJ/MzHBiWBAWcgT+sChRJeg/QJNEq/zHRlXecyw1JNkKty9nBWuMGxOdEqomX9o CgR04YYQIFTLZAKJCVStED+xKOMvfAA5TUCoI/QjVpzfbN2RtpuXEQU5qTUVNBbHyZOq bbGtlTdzHV5FJmd7rZIm730qggpE/HdiFIauAj/4VXJDfQ/i7FEeoyW1PmzCHvl1MvX6 tBg5ti4sWjYtSOcqx7BU5zjbWquT0ia0J23A5sj5u2i0hWB3krGPmE9290YKUfKZ3aoH wxvb6c6txjPYNk7/MVyjJPhDePxFqFhZfCb3LL1EnUmuFbEjHUcDMob6lOVyRDgPxMPU HLmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eRXbtH0f; 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 131si7543540pfu.165.2019.06.11.10.07.52; Tue, 11 Jun 2019 10:08:07 -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=eRXbtH0f; 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 S2405570AbfFKQ5m (ORCPT + 99 others); Tue, 11 Jun 2019 12:57:42 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33819 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404099AbfFKQ5l (ORCPT ); Tue, 11 Jun 2019 12:57:41 -0400 Received: by mail-pl1-f196.google.com with SMTP id i2so5374925plt.1; Tue, 11 Jun 2019 09:57:41 -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=LRf7jr0/HLf72a+GCXiXIigk1cbBqM+c/XCEYVEbVfg=; b=eRXbtH0f1kXlU/cWfbn2hNQ0rQG8fc8+TxdPwtiZfqj/7Okr/zjWiIo1pjc5NtrpGS qroG2rFEMyH02ZhC+Mllt9e351NOylIugvL3xEybuCPelPlWQ+IagF9emLex4b2Tj+Zp 9NOFE66x219JcSYURURWOPD3Ec5nwdvLh3U5u3HxiSsXKd0KbP0ELQuu6Lf9r9Bc2VHe UGqoZQm5kDnvTjiqglU8e3f/XlZ6Sz82MA14d6HIZgnTFZFXDwy2Pi+323YkZW3RBY4X toZRcrKRW1evx4JP7mAuiZyiYsuo/erougOEJoxqfv1HYkEMMnqRIjl/goKTkIT8p5B6 sRmQ== 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=LRf7jr0/HLf72a+GCXiXIigk1cbBqM+c/XCEYVEbVfg=; b=H9GXAObt9aUT/9hKsleHNKiA2uxh0zpM0h6t06uwo46sZiwdQG5H/qdH90qzvrnBe2 cKFSzV9RFD4aKpF+VcQ2fTJOVkXje1tC93AsrguFiI3S4NclCU0gRxu1rQhDZoS6pWxZ ySPKDA0qlQ4Jsoy1Gv2sA2KK7RR+av7TLebBjGyBrZ5JpHl1iQ32+VpwRSOXeIBkEvYZ 3BS1kJQYGAdNu+EI4obJc7FL8WB+SDIAZl88sw1DIuXGKhAyw4DwSUcPExWyARuE33nb 33hz0rV2iS/0/reZBPBfVGw9nBZJOfBVHHnaNYyAF2FLTRBMryDUEUTtoHuyZMVRQ3Nr htNg== X-Gm-Message-State: APjAAAWI4tE2jorl+ioUyd9USDozHDbGzJs2s86zEfoLabXLeO+9ZwaN WcS/ase+hJyiG1RKasxqmJQ= X-Received: by 2002:a17:902:8d92:: with SMTP id v18mr53873863plo.211.1560272260451; Tue, 11 Jun 2019 09:57:40 -0700 (PDT) Received: from [10.2.189.129] ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id c11sm5644951pgg.2.2019.06.11.09.57.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 09:57:39 -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 09:57:36 -0700 Cc: Sean Christopherson , =?utf-8?B?UmFkaW0gS3LEjW3DocWZ?= , LKML , kvm , Paolo Bonzini Content-Transfer-Encoding: quoted-printable Message-Id: <153047ED-75E2-4E70-BC33-C5FF27C08638@gmail.com> References: <1559178307-6835-1-git-send-email-wanpengli@tencent.com> <20190610143420.GA6594@flask> <20190611011100.GB24835@linux.intel.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 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. Indeed - I was sure by the name that it does it correctly. That=E2=80=99s = stupid. I=E2=80=99ll add it to the patch-set I am working on (TLB shootdown = improvements), if you don=E2=80=99t mind.