Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2412855imm; Thu, 19 Jul 2018 20:46:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdO9Spr8JJXPhYpHIp8mcO8v8AuCOIMtzLiunc36od993vuUqmI1NtWGJyaBFF38Br2JvtI X-Received: by 2002:a17:902:740a:: with SMTP id g10-v6mr443254pll.204.1532058384487; Thu, 19 Jul 2018 20:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532058384; cv=none; d=google.com; s=arc-20160816; b=BedJL5G4Ay+I0Bm5uUc++H7ARS2Qe8LMdfR5v24zXnQLD4dvGmvj4lEWTXZKiHVjOi /zzTUVFR8+stOOTP+08rY+G3UUs8zke+d08Z1P0xxF+2DD03FR2GXhfHnUYUraQy3acj AkKT/Im4sXjUhyqPWwkpiKrejjhAFFrjfFEBY88FEjUUo8Tm5KS44I/kRXJc5UBatoUu n8DlN33hJm6EJ2EfIOsoielishA+nrdVr+RSjM2bHebUYR1IXL7IW8otl8RQHSIuutFC I+qRSBC9kqQfWBkpeaK+AQbqFKJrn32R/WxCJf2N978/MkcpiYndHEYDhF+bFdR9YlKg GWyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Ulc5nI5SdQwAV7BaCcUKXThA96wYrHpBEjuECQz1uiA=; b=EArup9O/liUtMTYGbRwenQ4qaYpOxsRqVZsPIGo2oHlFudEmkLCaqI9Rn86tOSID8Q VtLz/xrLBDfutgCakfK8c16MU0UsvRJ2xiXMOjgwlLcP5c/nhPZN73+jNcfx0wEvSwlo m36ZF83iIgrc0N/UKr8ngjozHWEGdX7ivA8LyU92aX5ZsSi5v2OdmLWRFg5F85DIr1KE 2MvJKuSlYcmIwl37x9VQjgBbLKZjR/FeDsUEaN6cR7ahlSuTduyEvBTK+s4TXq669w+/ Suf7XC2xGpa2PFwkCxAifuGK0bsZbxQc06fXo4XSex5J740DuihjiSEJKvPEh9QwdIKq ZFxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r3AXs4jt; 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 h11-v6si895576pgf.558.2018.07.19.20.46.09; Thu, 19 Jul 2018 20:46:24 -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=r3AXs4jt; 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 S1726958AbeGTEbq (ORCPT + 99 others); Fri, 20 Jul 2018 00:31:46 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:36981 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbeGTEbp (ORCPT ); Fri, 20 Jul 2018 00:31:45 -0400 Received: by mail-oi0-f65.google.com with SMTP id k81-v6so18921687oib.4; Thu, 19 Jul 2018 20:45:35 -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; bh=Ulc5nI5SdQwAV7BaCcUKXThA96wYrHpBEjuECQz1uiA=; b=r3AXs4jtRtRS/dIPvqI39OifuqTrsHpS10dEqz2z3xp5jt3pOBoHiuK0dbeyxX7Dq3 OBxiKGfio0BOqn682GnMuikwJACucMUXvlchlxjljkWwYU4NzsDoNvYLxbjKqDo65Hn+ fZTT7JXKsg0BQY23kbz1xF2gj4btMTWwGf5QyMxlSMS26CtP0g7cerNTpn64kMs6Lk0B tO1H1+baR4GaN/fW/LvcmsSJmTu7vmLlzVjBfQ/J5Nyo8ecEb6Udeyrf2OenTIbT92wP BC+OOkrLXUXOy+f7ybaatjTNxooMC8rY1Sy0VQPhPc1oI9FqPMhtWasYREGXBmgusHtF 6fpQ== 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; bh=Ulc5nI5SdQwAV7BaCcUKXThA96wYrHpBEjuECQz1uiA=; b=ZvqXsnhTgPYZqLGEi5dTWtIIYkXaec0B8Mt7Qgg+wkxDrTNLQqwX5X7A5k6Tnhy6is uw2qViuiYVd8F1w0U3Y2+QiUL9m7ztoy9712Z0dVmcrEA2enbP4AC4RoEWjnGpUBf1Vr pg2uWMPk7pH0WNQmSC9gctqDmmm+Is/GDcWjSnDftlMEeM+jJ9ac7VpZ72Ah6FT+/ipk 8QXiOBgA3rD10iIvW/lEWc9ckL4FCFv9p3LBuh/mefT9+scqaAekmx5YenGo/8OGt636 D8U32iUnCW6CWvR8u003XJoTjlz1uC7hpCEBdlpBGP0wiHAiENmP4xzp5uOT3j5YkfOF nRww== X-Gm-Message-State: AOUpUlHZKWh/3A7cHLRpOfsF0ZScJlWdjGN9EzdRMAxn9RVmAjd5pQoH 9Kjvf7toKKbyCJfoPZi6dsPLAPXi0tcus3Ui9pM= X-Received: by 2002:aca:ad4f:: with SMTP id w76-v6mr381282oie.233.1532058335566; Thu, 19 Jul 2018 20:45:35 -0700 (PDT) MIME-Version: 1.0 References: <1530598891-21370-1-git-send-email-wanpengli@tencent.com> <1530598891-21370-3-git-send-email-wanpengli@tencent.com> In-Reply-To: From: Wanpeng Li Date: Fri, 20 Jul 2018 11:45:40 +0800 Message-ID: Subject: Re: [PATCH v3 2/6] KVM: X86: Implement PV IPIs in linux guest To: David Matlack Cc: LKML , kvm , Paolo Bonzini , Radim Krcmar , Vitaly Kuznetsov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Jul 2018 at 07:05, David Matlack wrote: > > On Mon, Jul 2, 2018 at 11:23 PM Wanpeng Li wrote: > > > > From: Wanpeng Li > > > > Implement paravirtual apic hooks to enable PV IPIs. > > Very cool. Thanks for working on this! Thanks David! > > > > > apic->send_IPI_mask > > apic->send_IPI_mask_allbutself > > apic->send_IPI_allbutself > > apic->send_IPI_all > > > > The PV IPIs supports maximal 128 vCPUs VM, it is big enough for cloud > > environment currently, > > From the Cloud perspective, 128 vCPUs is already obsolete. GCE's > n1-utlramem-160 VMs have 160 vCPUs where the maximum APIC ID is 231. > I'd definitely prefer an approach that scales to higher APIC IDs, like > Paolo's offset idea. Ok, I will try the offset method in next version. > > To Radim's point of real world performance testing, do you know what > is the primary source of multi-target IPIs? If it's TLB shootdowns we > might get a bigger bang for our buck with a PV TLB Shootdown. The "Function Call interrupts", there is a lot of callers for smp_call_function_many() except TLB Shootdowns in linux kernel which try to run a function on a set of other CPUs. TLB Shootdown still can get benefit from PV IPIs even if PV TLB Shootdown is enabled since IPIs should be sent to the vCPUs which are active and will incur vmexits. PV IPIs will benefit both vCPUs overcommit and non-overcommit(which PV TLB Shootdown can't help) scenarios. Btw, hyperv also implements PV IPIs even if PV TLB Shootdown is present. https://lkml.org/lkml/2018/7/3/537 Regards, Wanpeng Li