Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp169436imw; Wed, 13 Jul 2022 22:10:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tR9q+NCZr+GpZn+i7MJsFmIjsMsZ3pSVPOU0UT7H5gzv25OweGKO6jpAXMgr+oeswkVU46 X-Received: by 2002:a17:90b:4a51:b0:1f0:da2:3969 with SMTP id lb17-20020a17090b4a5100b001f00da23969mr14094942pjb.177.1657775419462; Wed, 13 Jul 2022 22:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657775419; cv=none; d=google.com; s=arc-20160816; b=Xw6OAbDvkARmuhs7T15yX++8ekl6fqB1wVHRF3n+cq+uz3P7KHYxvnBICWFLeP1Em7 2E22z31wgSPmU7253unrlf/MPK4gMlH8voEJbjAWJkhPDqp7WMZBSxck4cRnmKb6jd/M BRMZb6K6a6ZUbLzgMVzB528A+v9Jintaw5h7s0cRTVBsrqHk7+rLfj6CtB9tmIpFhDQb Z8Q2lUfD2Qr2xMkFk2GzUOzWdvrKNWnjWZy6VIMR5ydSA1IDviBHDchEfrh6qlEFrtI5 GkIRkpnqWyoxR0+Pwhp5dWMofWrBVRQxwk+J+FQ3gzRmATdR1ZIw6Kh35/0z8gi6oIVP LQ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature; bh=mPNTLDlr+MERvHd//NvtfOPSehFEbr9HKIRv/4zVS1M=; b=0vTunm4G6JHcDjVL34BlV5bfA5wachX3FkBptvqVVh/qeibrNlA7N74kNuNGGAvq1/ aUj3qRhynF0N2SXP90Xgl1vbuCQqac83qH7gEv61l5r1HHrkHaPmyYw6T9ySLkoHTo5x rew0fi+oaJeplO/VOebgd1bm/Eq+sRTcy6hWr1Q2r8nGXVrKK3K8yxo3GR3dHyz5BG+X vHTnNM4dWO1ojFS0G+67xo1QfloPJ7MJPbUQIi2x5gDb2aQVzu28fus7QqPFdPZLeGnY vaMdvharJ4VxDzyeFApahM+0N1y/WFpkb/uaBrpUjHzz5SQOwtnPjIgZpDAtpNm6MJ22 OOMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BCYfQniF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i189-20020a639dc6000000b0041604920dc3si593396pgd.840.2022.07.13.22.10.07; Wed, 13 Jul 2022 22:10:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BCYfQniF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237749AbiGNEmn (ORCPT + 99 others); Thu, 14 Jul 2022 00:42:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234778AbiGNEmO (ORCPT ); Thu, 14 Jul 2022 00:42:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03BFD46D9E; Wed, 13 Jul 2022 21:29:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9567561EDE; Thu, 14 Jul 2022 04:29:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A08CC341CD; Thu, 14 Jul 2022 04:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772974; bh=fZjf6kM0D523BGGdK0aisyqfUcBCAbftTGPrzQxmYl4=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=BCYfQniFbTmcpOoHE0lYCjN4DfF37sxERgNS1eP0Dqt0Lic2JfV5/LbeVXB317B4/ yt5+I1TnOiCgNVQfsyJGbwJWCVtitdWUhoEyR7Cm42+LtO6yxIUPbYzspnRCaEAo3b IMqt9ZeR+nwjTsJvtmBYvudD2oNoba1Oz/mKShdjrRlKJrwLpkxcXiJfJLEDjiPTFy XWjlAPolLAQ9vKNDp/Dfpe2Szqj4gD3FBWtKZNid/8EBB594sPiFh/lK9QXnpeYCIM sq/2EVFrev/ePOmQOi0ri+ueMn91PEu42ZxGRWEMbHqyq65dolJRwGAjyXSYtttmbO i1R/XjwhXjg4g== Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 27C2D27C0054; Thu, 14 Jul 2022 00:29:31 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Thu, 14 Jul 2022 00:29:31 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejkedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehn ugihucfnuhhtohhmihhrshhkihdfuceolhhuthhosehkvghrnhgvlhdrohhrgheqnecugg ftrfgrthhtvghrnhepvdfhuedvtdfhudffhfekkefftefghfeltdelgeffteehueegjeff udehgfetiefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnugihodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeiudek heeifedvqddvieefudeiiedtkedqlhhuthhopeepkhgvrhhnvghlrdhorhhgsehlihhnuh igrdhluhhtohdruhhs X-ME-Proxy: Feedback-ID: ieff94742:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id A4A7431A0062; Thu, 14 Jul 2022 00:29:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-755-g3e1da8b93f-fm-20220708.002-g3e1da8b9 Mime-Version: 1.0 Message-Id: In-Reply-To: <13d25d2e-ff79-5762-ddb8-87df56f5cbcf@amd.com> References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220713075738.GC2831541@chaop.bj.intel.com> <13d25d2e-ff79-5762-ddb8-87df56f5cbcf@amd.com> Date: Wed, 13 Jul 2022 21:29:08 -0700 From: "Andy Lutomirski" To: "Gupta, Pankaj" , "Chao Peng" Cc: "kvm list" , "Linux Kernel Mailing List" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, "Linux API" , linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org, "Paolo Bonzini" , "Jonathan Corbet" , "Sean Christopherson" , "Vitaly Kuznetsov" , "Wanpeng Li" , "Jim Mattson" , "Joerg Roedel" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "the arch/x86 maintainers" , "H. Peter Anvin" , "Hugh Dickins" , "Jeff Layton" , "J . Bruce Fields" , "Andrew Morton" , "Shuah Khan" , "Mike Rapoport" , "Steven Price" , "Maciej S . Szmigiero" , "Vlastimil Babka" , "Vishal Annapurve" , "Yu Zhang" , "Kirill A. Shutemov" , "Nakajima, Jun" , "Dave Hansen" , "Andi Kleen" , "David Hildenbrand" , aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, "Quentin Perret" , "Michael Roth" , "Michal Hocko" , "Muchun Song" Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory Content-Type: text/plain X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2022, at 3:35 AM, Gupta, Pankaj wrote: >>>> This is the v7 of this series which tries to implement the fd-based KVM >>>> guest private memory. The patches are based on latest kvm/queue branch >>>> commit: >>>> >>>> b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU >>>> split_desc_cache only by default capacity >>>> >>>> Introduction >>>> ------------ >>>> In general this patch series introduce fd-based memslot which provides >>>> guest memory through memory file descriptor fd[offset,size] instead of >>>> hva/size. The fd can be created from a supported memory filesystem >>>> like tmpfs/hugetlbfs etc. which we refer as memory backing store. KVM >>> >>> Thinking a bit, As host side fd on tmpfs or shmem will store memory on host >>> page cache instead of mapping pages into userspace address space. Can we hit >>> double (un-coordinated) page cache problem with this when guest page cache >>> is also used? >> >> This is my understanding: in host it will be indeed in page cache (in >> current shmem implementation) but that's just the way it allocates and >> provides the physical memory for the guest. In guest, guest OS will not >> see this fd (absolutely), it only sees guest memory, on top of which it >> can build its own page cache system for its own file-mapped content but >> that is unrelated to host page cache. > > yes. If guest fills its page cache with file backed memory, this at host > side(on shmem fd backend) will also fill the host page cache fast. This > can have an impact on performance of guest VM's if host goes to memory > pressure situation sooner. Or else we end up utilizing way less System > RAM. Is this in any meaningful way different from a regular VM? --Andy