Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp383038pxb; Thu, 21 Oct 2021 01:11:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmhRLaljH5mT8VZJTh5jZYJLiut1cEzzj47BTx2mDBc3ze5OufNvf+WKdwfKxBCSrFc50j X-Received: by 2002:a17:90a:245:: with SMTP id t5mr4757798pje.133.1634803886902; Thu, 21 Oct 2021 01:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634803886; cv=none; d=google.com; s=arc-20160816; b=j8IRdeXf/YtmKvuEiMavwCMGwCjQdW6UzoVsk5FynKBm1fk4OUCkGCcdvcYIQ9tydq hEPoLgwPpgDXmH3WGMOP8DT/gJn5GcZqq979dDbUxksvwVKu31hU+2RVhCsdW+00gs9l c0CYA1Dc1KzAYHeN4o4zKE+Hp702t3QQO/Xmv1Kg3BsJ9t3Vr9FM+gY7Heu0uNWItq4B jm2B/kWJHOVyOc8GOdz0vcy95Ci0fA6X7hluQsr93nV/jaj/qbrcZORUjjlg8c9SQUyj eW6gAdZm9JfDTGfn+wDlNnC6sfPnUgX43IoVmvm+m2ncY7U/e0he82Cm1ZQYqug2Utfu UZsg== 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=CTMN7KPSN1O5qa7pBmYhGzxVKXXjGfCRzg5sewZUslM=; b=vmgq2Y+lVSNNK8lU9+V9ixuGKn/DvXonsJ3V5yFfncEWC89svHtSnya7rDR4Hl2bgx YPyhNHlkX3JfjsmJWjnh/ei86mpURnkvLAhKtY9Yoz8/IQBP6Gtz7vbTmi3Aob0SV5H6 ubI7fzGKS84gBEYoRhks5+vk6PTT4UQPU+8vGEM+apxqgDWhCh4XbcV30tFMXnt2nuSN 1K20x1Zrs7L4EmvAAMVWkdcLGtj1DosieUB2l/KvsZr48c0dj/vmFYpFuuSnFQ82/D4s WmUEiVyhABbXENr1fHE9Gtme4wN69oNwu4U/LQaN1OMpQJ0wN7TCJcILEJsBIKNe08ed VV6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GTV1F9mS; 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 ob17si2939251pjb.78.2021.10.21.01.11.14; Thu, 21 Oct 2021 01:11:26 -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=GTV1F9mS; 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 S231315AbhJUILw (ORCPT + 99 others); Thu, 21 Oct 2021 04:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230440AbhJUILu (ORCPT ); Thu, 21 Oct 2021 04:11:50 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CC3CC061749 for ; Thu, 21 Oct 2021 01:09:35 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id 75so24902515pga.3 for ; Thu, 21 Oct 2021 01:09:35 -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=CTMN7KPSN1O5qa7pBmYhGzxVKXXjGfCRzg5sewZUslM=; b=GTV1F9mSqqd/MCvNFw2oK1SsYaOm61Qz+NoJqypSMtO0gw4i4JISREYIVYyl0FJl5U D4o/Bz9hrmQLOjjmOGpVLec6cyB4q2lOdfgULri1oGcPxGdb23LP6CD9mLBZkgnzyNe+ jYr/pmH9tE6GbXU9o9majTgk5H4G8gyA4bonk= 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=CTMN7KPSN1O5qa7pBmYhGzxVKXXjGfCRzg5sewZUslM=; b=rqyiDDIgFVrHkoIKWNFxn6GU46WPcd6P4XISo//Qn7xfJgyZI7zEK2nf/EsOzrxma1 c8FZf11/8/d9iEDCH5Yml8CbSFSdYR9b6G42qJErifJW/OIsTXixyauLTqImMs8d7fB0 NHSwk9B7Rm+pLY3YpZvl5slMg+rx46kjuO8UO2oF/v6rBCqpfYsnz3Ms8dYjuQm5Fc5+ yucVAc08aFHGJJslB/+xHcHULDDBMd6mAXIqDIaXOY8ig3jFeDT+Bxsyh2MpRa/EtN0H YAJfCzay31a9VA/PSGdQL+1gCzlIzKLemzSyPg2vL6T/k7YgImjQAuYc2FvRIbp47wAG j1Vw== X-Gm-Message-State: AOAM5305qjWPKryKFUJmBkow/uEoLy+Lm5eb4xxldeeoVfJp9am4Mxme SG4/2QIHa9Hh/z9DxBQu9bx2WA== X-Received: by 2002:a05:6a00:1a8e:b0:44c:f3cb:2a77 with SMTP id e14-20020a056a001a8e00b0044cf3cb2a77mr3798213pfv.53.1634803775131; Thu, 21 Oct 2021 01:09:35 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:e48:6cef:6c37:c98e]) by smtp.gmail.com with ESMTPSA id s13sm5724536pfk.175.2021.10.21.01.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 01:09:34 -0700 (PDT) Date: Thu, 21 Oct 2021 17:09:29 +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 12:28), 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? No, never mind, that's probably expected and ->mmu_lock contention is not severe.