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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32D64C433EF for ; Thu, 14 Jul 2022 04:29:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 939BB940178; Thu, 14 Jul 2022 00:29:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E853940134; Thu, 14 Jul 2022 00:29:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78A14940178; Thu, 14 Jul 2022 00:29:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 69F67940134 for ; Thu, 14 Jul 2022 00:29:37 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2EE2420A9A for ; Thu, 14 Jul 2022 04:29:37 +0000 (UTC) X-FDA: 79684426794.02.40750E4 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf08.hostedemail.com (Postfix) with ESMTP id 71251160066 for ; Thu, 14 Jul 2022 04:29:36 +0000 (UTC) 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 ams.source.kernel.org (Postfix) with ESMTPS id 8DC3EB8236E; 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657772976; a=rsa-sha256; cv=none; b=T523+f4DnyOlCzI1GjLYGrsKRzjJaoSHO3fBlqVdX1zyua1JZu80Q3shKjbXWh4uGLAaGG NcnHIafDjG4vSjadaznZUFWSRj+kZBHQDNvd4LvR1XjwyzC+36+sVP3Piv/0YFeZHz5gFq 4EpFJWRviN1ReoNhSR/Dxz4HVHjzDiI= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BCYfQniF; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of luto@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=luto@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657772976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mPNTLDlr+MERvHd//NvtfOPSehFEbr9HKIRv/4zVS1M=; b=sixllhAs1fB04QvBWVGYboVg6PwsRF2Au3sP+UnqYLfGLWHgEXjFI2JQGfNDPb9bB8rIza Pk0vdJRxRfLeeOS5OtHJYoHGxpEMUTQBhfS4y48oBfEPLkQ3Kda4qEqQpZ9O46NfN5w1Hd SNTN2y/ylx/97D6fak93IzxS18Z5YCM= X-Rspam-User: X-Stat-Signature: h8k8ihowr5adg6mgygxdt95tf5qk9yxh X-Rspamd-Queue-Id: 71251160066 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BCYfQniF; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of luto@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=luto@kernel.org X-Rspamd-Server: rspam03 X-HE-Tag: 1657772976-502493 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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