Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp219063pxb; Wed, 20 Oct 2021 20:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ3q8RnFUOqAXAq7Y6yPx/yX4tpuN68YlgUtamZX2fglNKMZQG5RF9EoYHbXXwQQ5Lcrag X-Received: by 2002:a17:906:a986:: with SMTP id jr6mr4039423ejb.520.1634787333540; Wed, 20 Oct 2021 20:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634787333; cv=none; d=google.com; s=arc-20160816; b=GVrP+raIVafue0wTvQOmNBlMJz6ExPDTnrbKJaguZQo0n4/9zYd0B/YffKOFc/Eol+ vIsCShaaAFm+OAgoAst2bSSTWDSBzGAgvGGJYLfX/MmHF0i9RIgFZi1io7JzCrist105 cduAlqpcmW1vscnDzl1dnODZ58M1MawdVHnJ4X8Ro0u7SFOaL/2U5MqMt0rlBM8nWPFt 4uDRzqwY8pyqV/jQs3TKQETJXiwcpjMGapYQEstlj03QPyUSt8ghRR/UOEAKv+CUEZOC GzBhg5EWG59lK9gdLQ0jKC8BW6V8vbiCremD/75QE4pTkBheWjDe75obUpYLtrfkCKu5 EeLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pnh8bcyRjTrFkmOUHRbArZzuERhrJtMq46zgeHiKn8Y=; b=ncX7r1vZeeA4uEFC74rJpgfCvj4/61dOU73EzTY8Mvk4PJ6pc/kBRT1WCJ+wiKcOAM s8eVPpr6x5w+uLv5YSUe9b3/qvZB8PZ8eCFOm6n60VzfT4JN3g1rFyAAtzJkXtti0pji Z0A+pCdvGR59jYzvfEtKJJspZX8A27XpSwKACPxQP0Qvqofxe5WyWf1kQI7HZ6I4QwVf OcZHaF1ErrgTyDBCZ58BHRXGGlCBOvWhzgPv5JkXw6RwAYTtBJiDwmHrVa90SzcM9ain GT3aIsxRD3AaSbzmgeK5KKWBY0dgUYA+a+G9j1coaucPFnvyvvTpZgPaqAUIMzGG6YPz /S9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cauuv1uj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb28si7696451ejc.136.2021.10.20.20.34.55; Wed, 20 Oct 2021 20:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cauuv1uj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230308AbhJUDa1 (ORCPT + 99 others); Wed, 20 Oct 2021 23:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbhJUDa0 (ORCPT ); Wed, 20 Oct 2021 23:30:26 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0148BC061749 for ; Wed, 20 Oct 2021 20:28:10 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id a15-20020a17090a688f00b001a132a1679bso2106667pjd.0 for ; Wed, 20 Oct 2021 20:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pnh8bcyRjTrFkmOUHRbArZzuERhrJtMq46zgeHiKn8Y=; b=Cauuv1ujQRryXJrICExsWu7CW72/1HWtrSb1GYwtYwkBFkUYrpj6ApUheJRnh2swyG O3vIPOYG0u3bLtQMAVbsIIxkOBliaB4RBU0S/JmihkqQNQuMdmHCN10KCH8Swx5uhw7F qY7hqiSbNgvLr6TVG7w71gWOlWavsV9ebke9c= 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=pnh8bcyRjTrFkmOUHRbArZzuERhrJtMq46zgeHiKn8Y=; b=mzWf+kHdwbjFT5KMVzGUcy4XS/bbZaFjiea2s2LzY/BqPB8RooBaOoikFTX8MRk7KY IXsuCzxmJsH8+UIobWQMWsxi0rmGO/cuPc7s67u2h26h2iXaW3g+sz8SDWbQ9RproRX+ bBLzTSufR0j0HY5B6u6oYKBkgxDhqCgSXJrFR11Ka7kjeloLVPNaVaivsfxoy2BkJMyl xjZfoTaFL1kzBI1IHVNamLNXroN8WpWNVWo6jSbHkCGHdEXNAcVOtgFge0kiyJgYmJUm pISaSTQaPjIQ6tz14xKdsY51Afrk4Wz08pBY5742AcPjn/NOEOPlDphIqKs7JqjKxAA2 +pRQ== X-Gm-Message-State: AOAM531K/SDyPZsWc1cYXF2fHGk9u6siigm80F+o2P7xRU4nHrxuSwDe 0EjeYUXmtwkaBIRU5wnCiliDXg== X-Received: by 2002:a17:90a:c08d:: with SMTP id o13mr3559912pjs.181.1634786890448; Wed, 20 Oct 2021 20:28:10 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:3bbb:903f:245c:8335]) by smtp.gmail.com with ESMTPSA id qe7sm374163pjb.1.2021.10.20.20.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 20:28:09 -0700 (PDT) Date: Thu, 21 Oct 2021 12:28:05 +0900 From: Sergey Senozhatsky To: David Matlack Cc: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Suleiman Souhlal , kvm list , LKML , Sergey Senozhatsky Subject: Re: [PATCHV2 1/3] KVM: x86: introduce kvm_mmu_pte_prefetch structure Message-ID: References: <20211019153214.109519-1-senozhatsky@chromium.org> <20211019153214.109519-2-senozhatsky@chromium.org> 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 (21/10/21 11:48), Sergey Senozhatsky wrote: > > We are using TDP. And somehow I never see (literally never) async PFs. > It's always either hva_to_pfn_fast() or hva_to_pfn_slow() or > __direct_map() from tdp_page_fault(). Hmm, and tdp_page_fault()->fast_page_fault() always fails on !is_access_allowed(error_code, new_spte), it never handles the faults. And I see some ->mmu_lock contention: spin_lock(&vcpu->kvm->mmu_lock); __direct_map(); spin_unlock(&vcpu->kvm->mmu_lock); So it might be that we setup guest memory wrongly and never get advantages of TPD and fast page faults?