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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37BC5C43334 for ; Tue, 12 Jul 2022 01:38:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232073AbiGLBiL (ORCPT ); Mon, 11 Jul 2022 21:38:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231202AbiGLBh7 (ORCPT ); Mon, 11 Jul 2022 21:37:59 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A92B48EB6 for ; Mon, 11 Jul 2022 18:37:57 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id t5-20020a17090a6a0500b001ef965b262eso6514621pjj.5 for ; Mon, 11 Jul 2022 18:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WviUjYGm+rN9XZgfwTaOdA+cnHAG88Jjo15LstAimgU=; b=INQAY47xH5htGVWI6UXlhorRrnL8Jd67/7TotuHr9Sj9U8E/eQW+SGdq7tonkWTVAn FOJxZvWR8Uf2UbHQQPBPYoUi5ZmRce3XsWUoQl4uYlVB0nMWiANPqeH5Nx2nU3f+5RX8 GMFItyEoZeta9dQdpR6EyUjK4xP8StQ8Ia4ituvuhIXuU9MenDzRkpZejumsSUkKtwIY JL1En2I86PftH9nJW4fPB5UBTucIgB4o37q1itOTnRHEEPkZQw8/upHLL9a7fwuQzmCF 6eNu90XjgrueTFDv7yFudUAyGR3ctQRuqexZj3PRPTI6tC1Q8czyidWls5WU8IlTN1zp FrUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WviUjYGm+rN9XZgfwTaOdA+cnHAG88Jjo15LstAimgU=; b=UIQdM/0Md8XLZDSQo4qWv6l5XZBi6SArodJlUxVA/kKYQlPDbwzNKUjLcQ3lGZu6uG IaqUvQmjAhNLyYbCGpKC/045m1HWzqrdQCFJRhsr9JkCMHumAHWOBMhLv9i64XPHDgjD xhxftQ97tG7ixgcchBwaNfh/ACuiZM9OoRsWI0C6/4NT40oXyBu9YizcwBy48dIiBx26 EPHBluKRpYBTJXsmRgQrw5UIycCqlt5NVOUKv+QGn0SzGvfa5crirVLC5ZETIgWZreqO 5AOBNj/bP7OwJGxfRRzOs3I25E1OFtI31n7/mQce3A1dqA03wzzAUDdnH7Sz7EBsyZwz GGDw== X-Gm-Message-State: AJIora9stuMLlDyMtSi4mFxZ4cFEeXOAO+o9LWOKwBqg0thQImr31EOP fhlfoM89cz/dqutLi/dkygFPJg== X-Google-Smtp-Source: AGRyM1tiApB8857nuLuRMh9R8W73BEsT4Ar4OmhPOWBlXNDA6ziygmeb27ZfsxASqtW3V9Ck1dc4vg== X-Received: by 2002:a17:902:8508:b0:16c:46ff:53cb with SMTP id bj8-20020a170902850800b0016c46ff53cbmr8702022plb.168.1657589876315; Mon, 11 Jul 2022 18:37:56 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id i9-20020a655b89000000b004148cbdd4e5sm4856317pgr.57.2022.07.11.18.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 18:37:55 -0700 (PDT) Date: Tue, 12 Jul 2022 01:37:52 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Ben Gardon , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Peter Xu , David Matlack , Jim Mattson , David Dunn , Jing Zhang , Junaid Shahid Subject: Re: [PATCH v2 0/9] KVM: x86/MMU: Optimize disabling dirty logging Message-ID: References: <20220321224358.1305530-1-bgardon@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 25, 2022, Paolo Bonzini wrote: > On 3/21/22 23:43, Ben Gardon wrote: > > Currently disabling dirty logging with the TDP MMU is extremely slow. > > On a 96 vCPU / 96G VM it takes ~256 seconds to disable dirty logging > > with the TDP MMU, as opposed to ~4 seconds with the legacy MMU. This > > series optimizes TLB flushes and introduces in-place large page > > promotion, to bring the disable dirty log time down to ~3 seconds. > > > > Testing: > > Ran KVM selftests and kvm-unit-tests on an Intel Haswell. This > > series introduced no new failures. > > Thanks, looks good. The one change I'd make is to just place the outcome of > build_tdp_shadow_zero_bits_mask() in a global (say tdp_shadow_zero_check) at > kvm_configure_mmu() time. The tdp_max_root_level works as a conservative > choice for the second argument of build_tdp_shadow_zero_bits_mask(). > > No need to do anything though, I'll handle this later in 5.19 time (and > first merge my changes that factor out the constant part of > vcpu->arch.root_mmu initialization, since this is part of the same ideas). This fell through the cracks. Ben is on a long vacation, I'll find my copy of the Necronomicon and do a bit of resurrection, and address the feedback from v2 along the way.