From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B5D9C4707F for ; Tue, 25 May 2021 23:35:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 00DA4613F6 for ; Tue, 25 May 2021 23:35:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231838AbhEYXgl (ORCPT ); Tue, 25 May 2021 19:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbhEYXgj (ORCPT ); Tue, 25 May 2021 19:36:39 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B63AC061756 for ; Tue, 25 May 2021 16:35:08 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id t193so24023542pgb.4 for ; Tue, 25 May 2021 16:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Lxgxwvu6bAHcpIBi46sfdxXVLtVYTXMU6wXoIYMfsmo=; b=iMwF9Z55RdUMMmhqCYSVovxPUEagkTngm9ru8FdnFSF1csZzncsPoRuohZDl1LHKQe gya8NK5DEDRymB4uhEF/dm4tnjRJWoQD0yb9m+EHSejMhMxBJL+15CD1Cp8th4pCcYA9 mCFldpKyYixTuCUtxP5zVbMtvfYY4YCWpKtnfGyADb3GCJ9+Q7osXRt2JHEh1dCSVucX qUn0qIoZLH0o1+YwWWcJVaoqIX5cY3snS09BFtVwvw+wgGdqfYuJWeNP6FLpaNANdwFE rRKJsdDN+hcAA+hOTmD6bIJ0yYIDI2ABRPhBr7As9OlMzfqq44KJX3dpUKd45+4dJHRk RLMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Lxgxwvu6bAHcpIBi46sfdxXVLtVYTXMU6wXoIYMfsmo=; b=hCA936+HEx7s6aSZKDXi0l7N8gr0M66S5riYvkwNAI7nWzZnqDnzgm/hk4/3QGz/oj FtM5yDWfEqAZoBUJYKyOLIBV+zdQ4gvUdkpDwJFU4m36tehKPFUWwcamk32UE3XY/sJa AQnxXgML1sgP0e3h5HROGsinL1uTsbm2gj5wBsI86PWsj8/z9RhO6aVkPWWNrL380ZsO 0HyTbAIr3xmth3E2zcOHykiyPGihgN1u/EnTYQhjgGXV4pv9ZKQ27ARlxGs96e/RLarB IKEqHB32tmjm3QYEx+Kb1djagVhp7cyhFr7V+wx6GJ4nSc+/mV5fY7HKkzUcZyKNIpfW PJaw== X-Gm-Message-State: AOAM533Uv/povszeUBC3fkdKZ6oGHUbqZuSFAvP0Bv3NGk/nb05ikdqV gE2bidj0/8/zjC8rQnz+CWw/Fg== X-Google-Smtp-Source: ABdhPJzr+PEXMYZXU15SCAQLmYVDEP5e9yb/rTnDUO8P6McASC9IHAFm7vIdGRzrt9cwZYZ4huukeQ== X-Received: by 2002:a62:f24b:0:b029:2dc:9098:c14c with SMTP id y11-20020a62f24b0000b02902dc9098c14cmr32335885pfl.19.1621985707873; Tue, 25 May 2021 16:35:07 -0700 (PDT) Received: from google.com (240.111.247.35.bc.googleusercontent.com. [35.247.111.240]) by smtp.gmail.com with ESMTPSA id l7sm2864094pjh.8.2021.05.25.16.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 16:35:07 -0700 (PDT) Date: Tue, 25 May 2021 23:35:03 +0000 From: Sean Christopherson To: "Stamatis, Ilias" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jmattson@google.com" , "Woodhouse, David" , "vkuznets@redhat.com" , "mtosatti@redhat.com" , "joro@8bytes.org" , "zamsden@gmail.com" , "mlevitsk@redhat.com" , "pbonzini@redhat.com" , "wanpengli@tencent.com" Subject: Re: [PATCH v3 09/12] KVM: VMX: Remove vmx->current_tsc_ratio and decache_tsc_multiplier() Message-ID: References: <20210521102449.21505-1-ilstam@amazon.com> <20210521102449.21505-10-ilstam@amazon.com> <2b3bc8aff14a09c4ea4a1b648f750b5ffb1a15a0.camel@redhat.com> <8a13dedc5bc118072d1e79d8af13b5026de736b3.camel@amazon.com> <6d18b842e1ab946da2e0ebfae79fc51c3193802a.camel@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d18b842e1ab946da2e0ebfae79fc51c3193802a.camel@amazon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021, Stamatis, Ilias wrote: > Hmm, this patch actually still removes the caching and introduces a small > performance overhead. For example if neither L1 nor L2 are scaled it will > still do a vmwrite for every L2 entry/write. True, but there is an ocean of difference between the relative performance of vmx_vcpu_load_vmcs() and a nested transition. vmx_vcpu_load_vmcs() is also called much more frequently. > So do we want to get rid of decache_tsc_multiplier() but keep > vmx->current_tsc_ratio and do the check inside write_tsc_multiplier()? Or > alternatively delete vmx->current_tsc_ratio too and have > write_tsc_multiplier() receive 2 parameters, one of the old multiplier and > one of the new? My vote is to kill it, eat the barely-noticeable perf hit on nVMX, and tackle the aggressive VMCS shadowing in a separate series.