Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5330974ybi; Wed, 12 Jun 2019 00:21:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGOUIMHTYqjQEz/Utbxu58nTIoarR5/uWPocf8XKzp5coBDLvCVtMkHaEEV6kC5xKSePxf X-Received: by 2002:a17:90a:25e6:: with SMTP id k93mr10393806pje.100.1560324085563; Wed, 12 Jun 2019 00:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560324085; cv=none; d=google.com; s=arc-20160816; b=s1K+S+fq6L501vAzEtk6dO9ZsX7kbXgYSersjdkfAmyaKYoPZe9f8Vm9WmjuZ1On+M zQs0Uz1GJHg45AXmqEMHGTWtee4JO2geVKruucbVexjIN8JCTir/bVrLwMor9P66ffPS QPERHpLdQmJN0vjxhqeor/jb2pQdcWlQYl2EvEFru31EUfVeHMLT+jqYTk1CLZnRdOE4 Q4e/tKfBwwOinrGtwD/IxXDDHHLg0Y+jWZOhZIVeNvtE82SYytUP0Dxaho0gKDaEaBE0 An2QhiPQw/FqA0aSssF9VoPNfSLu4fb050umbOCUcs59jEjR7qbciGdD05IkBgWQTHka W4fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nSDY8zFKF7PHOkb9LEHVAO61FULkhNk92Ig0WDAkMeo=; b=vyv3m+OcevHGnbt/rKQSh3xaqlAtUFeIFJSEYE7b5IWKHUeYSQjL9PKXIZm2XEp8yN szW4qp2QYqCWmvFD9FOjXCDe02hcQJw0YJW43j/WbdPZHnTTjKNkzUeEYIjtMTAkV0v7 mM26gklfmOl7YVnvza+R2nzghF4ajUpgPdr/koG2RgbtzuEf0CFjj4yBsZum2BXVVGzD p1X3au0Yo6PZ7Pii2Bv729Vl4XhdeapGDOvinCbEI/EinUWBmQ9JvT6LupkYET7o3yuE YrIQvbjBclMIGGorCRq43S6dOnKuwNQgvx7Paf9uR1js953jOr0Y4TBX0cY1t47aiH9S +tLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Fak8lK+4; 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 y13si13652586pgq.172.2019.06.12.00.21.05; Wed, 12 Jun 2019 00:21:25 -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=Fak8lK+4; 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 S2408320AbfFLBSJ (ORCPT + 99 others); Tue, 11 Jun 2019 21:18:09 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:41522 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406608AbfFLBSI (ORCPT ); Tue, 11 Jun 2019 21:18:08 -0400 Received: by mail-oi1-f195.google.com with SMTP id g7so7257197oia.8; Tue, 11 Jun 2019 18:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nSDY8zFKF7PHOkb9LEHVAO61FULkhNk92Ig0WDAkMeo=; b=Fak8lK+4PNF9fTphDDAZgqPro0aWiW8+A1NlJtFHUsSkFFzto70eTDEOmYx+vU+Gcb IGC4MMxyC6DlqpylYL/43ZaCCZfEWok0L/KwJAqYHHPikQH7pbIsSJVPd5uICx+/4MJM LVeEiUXzkEHfmdxk8TaJ80bbulOZFI7e8SnfyfTsuyh5M5P6n9X03Bn+acaym/QH69hh IJ1VIjtBel3XjtrALGiDcDIjetB/S2sDRTwLH0R4ZlKOVEUIMVAR00CtpxZyXLi2gEte hrO8ozymXOWlDHv3X8nErfVdUe3OOcBxOGNv0F5SmjAeBGRxUTjfgmj7ez6kZVT9oFZW Wk9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nSDY8zFKF7PHOkb9LEHVAO61FULkhNk92Ig0WDAkMeo=; b=ZM0DRNI62J4dnQECvgA6Ac87+Jgi4l1vM4mb0LFEr9TPvIma4ekmKvv96rLfRMMfY7 PmH4vR7XAF0gLh+b/UPVpvXKUm1JF7QwnB1AikPSNfuKIfDnfeDwi5BtpbPoMU9L44XY B6EuJpLEpPjsVJ3URC3NcTMuQlLU92SKkKYf1YJrOhcYd6WfmzYaT06iTcM/O28UN5p3 2geCS8QpBAGSbQCzkePhzyDkuqmzSdSztmtIa2nuLxCimp4zbhKhRgGBuDyQitT6x4Tq fw4HjzkUKREeMdeGpb2lMevs3ckCscfB6sdtUDVFNRFGbuWFaJwIFq4N8PkotIzg6lyW fjaw== X-Gm-Message-State: APjAAAVa1ADofxpvAcPVNPO/6olLYeWAVxKE4aJ13VcvgYHhnyXuUzDI 6pNFXsJH4swEG5j2KZXaKetoHgc1G6jLFhEDHFQ= X-Received: by 2002:aca:3305:: with SMTP id z5mr15303551oiz.141.1560302288094; Tue, 11 Jun 2019 18:18:08 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <153047ED-75E2-4E70-BC33-C5FF27C08638@gmail.com> From: Wanpeng Li Date: Wed, 12 Jun 2019 09:18:51 +0800 Message-ID: Subject: Re: [PATCH v3 0/3] KVM: Yield to IPI target if necessary To: Nadav Amit Cc: Sean Christopherson , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , LKML , kvm , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Jun 2019 at 00:57, Nadav Amit wrote: > > > On Jun 11, 2019, at 3:02 AM, Wanpeng Li wrote: > > > > On Tue, 11 Jun 2019 at 09:48, Nadav Amit wrote: > >>> On Jun 10, 2019, at 6:45 PM, Wanpeng Li wrote: > >>> > >>> 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 vCP= Us, > >>>>>> yield if any of the IPI target vCPUs was preempted. 17% performanc= e > >>>>>> increasement of ebizzy benchmark can be observed in an over-subscr= ibe > >>>>>> environment. (w/ kvm-pv-tlb disabled, testing TLB flush call-funct= ion > >>>>>> IPI-many since call-function is not easy to be trigged by userspac= e > >>>>>> workload). > >>>>> > >>>>> Have you checked if we could gain performance by having the yield a= s an > >>>>> extension to our PV IPI call? > >>>>> > >>>>> 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.) > >>>> > >>>> Tangetially related to splitting PV IPI hypercalls, are there any ma= jor > >>>> hurdles to supporting shorthand? Not having to generate the mask fo= r > >>>> ->send_IPI_allbutself and ->kvm_send_ipi_all seems like an easy to w= ay > >>>> shave cycles for affected flows. > >>> > >>> Not sure why shorthand is not used for native x2apic mode. > >> > >> 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 mor= e > >> efficient - I=E2=80=99m looking at that code right now=E2=80=A6) > > > > 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 impro= vements), > if you don=E2=80=99t mind. 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. :) Regards, Wanpeng Li