Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1065756pxb; Wed, 16 Feb 2022 10:10:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3hdoHVeMw22IC+XxS+3+zr1oZnY3X4H36GZWsxU/J+tR9v1jqDS8J40sMsb4d5LLY+UYL X-Received: by 2002:a63:d917:0:b0:372:aede:b9d2 with SMTP id r23-20020a63d917000000b00372aedeb9d2mr3261467pgg.449.1645035036886; Wed, 16 Feb 2022 10:10:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645035036; cv=none; d=google.com; s=arc-20160816; b=LDf1DJNQAP9ZEqiFsCnkjZE3E7WfSnLdj823AeehVm6lFugB13OST/DSOP/R7k7Dq0 +HI8XdgXVjfxuZnuHeA+kb41unx32s4aR1yWe63giZEnOFBwqVfYuYViFJI7o3KPSZ3I J65EegrpvBX5YUYTe5coZuNxkZ5l+k842eQLfWkxdCJMg4K9rC+ovk/VkjfpmYy4Xxev gnoZujh/2AUIZDIKV5lQ3HsXEcLb8rhWK+OILooftGlZADkWbaLh6eBQdrPUYqW5HpXp yVBqgZCW7WBJIvmKP6fj11v1up1OflnLp+4jNmnYrFrZEBPKEy4YrcPvT4uL1fjk+HX9 xFEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yDpB++dvNrcqAJlyBBM88E31rOeEBSpFbNBIclLTgXo=; b=tp1HS1SYoK3oWi7LZLcRFvh7dyhQR/AhGJ/rsKpg5PiTVzQTOCarctkdsrpaJ0LS1Q NmDjEAEycf9Bd63IbTeJXD7jQqlgv2ioWSr9fQcEB0Pkwe1MMPI+7Q10R94zdnUVC8lM RvuT/2bNLAosDF4BnisNkYFAZE/xh7orGPTjzLWZRtpN/+9FBrK4ZPLnQlN2MlhKZLSb OWklPMj6E+Bfj82oqiL/OzejFdUbNmJcTNBjVRgZB1IKJXhR6I3s//oEZNcSjD3ZQHv3 Cnjjsxd7wCz22cinMp6ARttDJ4+dwP59FE4ylCO+uqUKnDFR6oiGW7FlLiZXsBGXilZA se7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=OnqQAVhn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16si6559589pgv.404.2022.02.16.10.10.20; Wed, 16 Feb 2022 10:10:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=OnqQAVhn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237365AbiBPRyT (ORCPT + 99 others); Wed, 16 Feb 2022 12:54:19 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234039AbiBPRyS (ORCPT ); Wed, 16 Feb 2022 12:54:18 -0500 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170C222E2A1 for ; Wed, 16 Feb 2022 09:54:06 -0800 (PST) Received: by mail-oo1-xc32.google.com with SMTP id o192-20020a4a2cc9000000b00300af40d795so3313452ooo.13 for ; Wed, 16 Feb 2022 09:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yDpB++dvNrcqAJlyBBM88E31rOeEBSpFbNBIclLTgXo=; b=OnqQAVhnLzGUgqKcIt3PmSKH4G+af9kqvOLRvGa2O8NG9yKoKacECt/CJOVQgRPfSZ OgWhpnhRHfbA4QYO7qfEqdMNK1nac2uRJoROPFgXTssmRUu4KlKxUBMmJ8ux02a15Kb/ 3s4nR9rrJ0jcnYrYcCm0DMX5pqSYo1KpCmrOBY6I518zqhOrcKAdPhrTxFcFL4iSbG89 DUyWssVO+HPtMvu0fDtrBAOHLMVxEim3syc0lJ8/+4XSICS5B4wbJCSWo7C3g2982eQ3 zA5qkyw6EheZ3nF3tCej1rLsDDQdn1Dg9z7MBBxKMQEknIOo1r3SH1JrMV005O2ImPh5 vafw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yDpB++dvNrcqAJlyBBM88E31rOeEBSpFbNBIclLTgXo=; b=e0SejiRXOm/B8NKdsPzgqvx1I3Vvg9bCxIVQifUfUU1n0YhpZSQc8ZCwNwRxW9ZZ/6 sxEyQzIXGSYHLUThBN0DYaEGM5sMHMZ1Ox6wHILhatvvT25oC4uoJu9wxk3dPK7QDAbl MtvaZT0NyJg3mThJJWFFh4xpRgttCWLLEfmVmQqKdroxC239GOfBlWMf1m2fAbmtrvgQ r9wSAno2e6Mua5ZmrxZWQiiSp6Jv56mp2vj3/0i1Fh3hCmV6yLcVoIHzXLaMGWunRBw2 lS4jE2DNOc2Hce2Nd/bSA440KAML47ZbL/c82esgYLNPLszWKPw1wvq4wILtDoqFMIxQ JxaQ== X-Gm-Message-State: AOAM531/4K252jyBFypFlwzAE2mLLw1dT7JhO7RO+Qr0h4+XlMIghZw9 iLBDyOraO+Weik7YHdtqH8t5euQXx4xSfCZ/EoFq0A== X-Received: by 2002:a05:6870:3046:b0:d3:58b:fbd1 with SMTP id u6-20020a056870304600b000d3058bfbd1mr921086oau.129.1645034045122; Wed, 16 Feb 2022 09:54:05 -0800 (PST) MIME-Version: 1.0 References: <20220117085307.93030-1-likexu@tencent.com> <20220117085307.93030-3-likexu@tencent.com> <20220202144308.GB20638@worktop.programming.kicks-ass.net> <2db2ebbe-e552-b974-fc77-870d958465ba@gmail.com> <39b64c56-bc8d-272d-da92-5aa29e54cdaf@gmail.com> <810c3148-1791-de57-27c0-d1ac5ed35fb8@gmail.com> In-Reply-To: <810c3148-1791-de57-27c0-d1ac5ed35fb8@gmail.com> From: Jim Mattson Date: Wed, 16 Feb 2022 09:53:53 -0800 Message-ID: Subject: Re: KVM: x86: Reconsider the current approach of vPMU To: Like Xu Cc: Sean Christopherson , David Dunn , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Stephane Eranian , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 15, 2022 at 7:33 PM Like Xu wrote: > AFAI, most cloud provider don't want to lose this flexibility as it leaves > hundreds of "profile KVM guests" cases with nowhere to land. I can only speak for Google Cloud. We'd like to be able to profile host code with system-wide pinned counters on a periodic basis, but we would like to do so without breaking PMU virtualization in the guest (and that includes not only the guest counters that run in guest mode, but also the guest counters that have to run in both guest mode and host mode, such as reference cycles unhalted). The one thing that is clear to me from these discussions is that the perf subsystem behavior needs to be more configurable than it is today. One possibility would be to separate priority from usage. Instead of having implicit priorities based on whether the event is system-wide pinned, system-wide multiplexed, thread pinned, or thread multiplexed, we could offer numeric priorities independent of the four usage modes. That should offer enough flexibility to satisfy everyone.