Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp83476pxk; Wed, 23 Sep 2020 23:30:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoOasxDtDTVXQAFR3gplxIPS36QxC+OKxyDi/ky3B1i8UCiaCo5gsCIPhO8tCO1j//VFZf X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr3040724ejb.516.1600929054660; Wed, 23 Sep 2020 23:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600929054; cv=none; d=google.com; s=arc-20160816; b=gjAsqXhXwTb9g0DUv8pGAZSSzox9YRgTgbpE9mppbxiNsa4aZUUcWxbxh6XpoKZj1M YrQcnIMy3SLu4o/l+xlffB4fohgItNfpdZgkl7WN6rcJW85hlafFLm6S1aOXGeqUaXqB wYnD7a6ZtX6ypwsE3WUa16yS2riSwnh3WHldfSYcusg9RQaMhT3YjjMz0+ouL7lODrlW 0TNyKsfT41hfmEa6F5MNlDhi+8AvdEi3DAuUJwzMd5w4AJgyGkV9aqKCfS5zDCUW8Zq1 254Yzci/4Og/VjWAZD4O8PBII0cXZ5wlwtBRUxK4/4t/5O1EXRv3R418cvcOCJ9XZGYR DIvA== 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=R1U3NxLbQjBixpfoPowGIH4NmhZQy3NaJU6pXboAykI=; b=yROLL36nDo+4GsakHC027UhUgj2QHP662TqycGhicm6XgOPPaBFT7wMpCo0IyTvt0V PSoS1XWg1GbdgTz6iFoBEItEsR9/1al+pwCxZdgtSsx77DZ9va3Egz2kF5YXzvKvjRq4 u1CDSWuEQlRPrJUP2ijmdmyRNDr3BTsxbG7c0vNhWHgO+/VxlMznhPyk1KXrC24HtsIs Tq6S759sa4FdSxQgt9lESeJuIN7zZLZis6YSlhAXgtJ9YQts1EzpadcCgKEhOGQk7P0k 56i504Ioo823/B3G6U2XBFxy+GVQAWJ9KrfvF9e35Tb7Qox2Qd6xuK+j8vvVYWYaxZGW jxyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MgDi5Bom; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si1346194ejd.451.2020.09.23.23.30.30; Wed, 23 Sep 2020 23:30:54 -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=@gmail.com header.s=20161025 header.b=MgDi5Bom; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbgIXG2w (ORCPT + 99 others); Thu, 24 Sep 2020 02:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726119AbgIXG2v (ORCPT ); Thu, 24 Sep 2020 02:28:51 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCAA3C0613CE; Wed, 23 Sep 2020 23:28:51 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id n61so2105522ota.10; Wed, 23 Sep 2020 23:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R1U3NxLbQjBixpfoPowGIH4NmhZQy3NaJU6pXboAykI=; b=MgDi5BomTbLhrvRAh9TM+NXFVCHyNulJ2QXWkiwF3yJjoLMt5e17ROsFDVINI7cZf+ wBTD4ZUr+tP+sRrBhCjk2WxwT/DzMt5Lfv3Kltzh2WUXUvQqVe/8nmj3hqfT/5z2Jra5 6k30fA01I9QBLQ3Xmkf2MnLqUzc6wInLBD/luevd28THHnDkAZB71jq9FqPE6gsiYFjn IYCS2EvDUvt5M1Rpps4Yn7LnGIFqXHQPODU0BLiUon/wvwB83cXcht9l7MsWQLwBD/5R FNrO7/vTaKnEcyO6PveRNX0+akGVdUG50K2WUoRwHXh2A/1TiBPMF+IJuEx2gUT/uBSB Tukw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R1U3NxLbQjBixpfoPowGIH4NmhZQy3NaJU6pXboAykI=; b=oFpGej+h96CDAcl2f/M+OywKjbIG4DxBit+RDzfi0FSNgoUyOJzzyM0n4hCzTL4x7g jYrYFJq2sbbwQJe9LKFuk0svrhxQAXCLX+uJwLytz61/Ej6gacOFQGnQjwotfM8uC1PL hI0qx91EY3fiv96M4lVD3uYR/rFIu5HhtFsnJMKCghVTsCSIezRl/Jq8ypo7E+hwTGOr kPhy99eryMLk4Bexi1SV1B3RqXTIgIHRFZx6BjxKwC1cAn+d3zfFMDwt2somclEgKLwu PBQRml2uXCchnTlUnkJPcGTCIW97/Vo6XK+Jq8BICZc2ZpELZQipNL0i9fogQSaYUYy5 QW5A== X-Gm-Message-State: AOAM531O5xCXoO7WE5mLxXi4k8lzHKQ3kxxPi70FMWznHEyFFqB1AqVq veg8QYM+7LMhUb6+hoxQVF9luk525WmM617EGIo= X-Received: by 2002:a05:6830:154a:: with SMTP id l10mr2066995otp.56.1600928931177; Wed, 23 Sep 2020 23:28:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Wanpeng Li Date: Thu, 24 Sep 2020 14:28:40 +0800 Message-ID: Subject: Re: [RFC V2 0/9] x86/mmu:Introduce parallel memory virtualization to boost performance To: Yulei Zhang Cc: Paolo Bonzini , kvm , LKML , Sean Christopherson , Jim Mattson , Junaid Shahid , Ben Gardon , Vitaly Kuznetsov , Xiao Guangrong , Haiwei Li Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Any comments? Paolo! :) On Wed, 9 Sep 2020 at 11:04, Wanpeng Li wrote: > > Any comments? guys! > On Tue, 1 Sep 2020 at 19:52, wrote: > > > > From: Yulei Zhang > > > > Currently in KVM memory virtulization we relay on mmu_lock to > > synchronize the memory mapping update, which make vCPUs work > > in serialize mode and slow down the execution, especially after > > migration to do substantial memory mapping will cause visible > > performance drop, and it can get worse if guest has more vCPU > > numbers and memories. > > > > The idea we present in this patch set is to mitigate the issue > > with pre-constructed memory mapping table. We will fast pin the > > guest memory to build up a global memory mapping table according > > to the guest memslots changes and apply it to cr3, so that after > > guest starts up all the vCPUs would be able to update the memory > > simultaneously without page fault exception, thus the performance > > improvement is expected. > > > > We use memory dirty pattern workload to test the initial patch > > set and get positive result even with huge page enabled. For example, > > we create guest with 32 vCPUs and 64G memories, and let the vcpus > > dirty the entire memory region concurrently, as the initial patch > > eliminate the overhead of mmu_lock, in 2M/1G huge page mode we would > > get the job done in about 50% faster. > > > > We only validate this feature on Intel x86 platform. And as Ben > > pointed out in RFC V1, so far we disable the SMM for resource > > consideration, drop the mmu notification as in this case the > > memory is pinned. > > > > V1->V2: > > * Rebase the code to kernel version 5.9.0-rc1. > > > > Yulei Zhang (9): > > Introduce new fields in kvm_arch/vcpu_arch struct for direct build EPT > > support > > Introduce page table population function for direct build EPT feature > > Introduce page table remove function for direct build EPT feature > > Add release function for direct build ept when guest VM exit > > Modify the page fault path to meet the direct build EPT requirement > > Apply the direct build EPT according to the memory slots change > > Add migration support when using direct build EPT > > Introduce kvm module parameter global_tdp to turn on the direct build > > EPT mode > > Handle certain mmu exposed functions properly while turn on direct > > build EPT mode > > > > arch/mips/kvm/mips.c | 13 + > > arch/powerpc/kvm/powerpc.c | 13 + > > arch/s390/kvm/kvm-s390.c | 13 + > > arch/x86/include/asm/kvm_host.h | 13 +- > > arch/x86/kvm/mmu/mmu.c | 533 ++++++++++++++++++++++++++++++-- > > arch/x86/kvm/svm/svm.c | 2 +- > > arch/x86/kvm/vmx/vmx.c | 7 +- > > arch/x86/kvm/x86.c | 55 ++-- > > include/linux/kvm_host.h | 7 +- > > virt/kvm/kvm_main.c | 43 ++- > > 10 files changed, 639 insertions(+), 60 deletions(-) > > > > -- > > 2.17.1 > >