Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp464260rwe; Wed, 24 Aug 2022 04:13:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5HTQFvIrfn9heYIi54EG5kz0P/4DTJ7nx9hgw6EfG36ef06aTSyEBCV1g4vTY5Z5UixFeQ X-Received: by 2002:a05:6402:94a:b0:446:6232:8461 with SMTP id h10-20020a056402094a00b0044662328461mr7145699edz.241.1661339590353; Wed, 24 Aug 2022 04:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661339590; cv=none; d=google.com; s=arc-20160816; b=Btn8y/CfE5Bj6aRy9f9QS/QH0/8YovucJRMF6uzqzsuBIR5gXYJPc4dy3k/6XJyzFf Wg3IdstugewwC2v7nePYxEOv883Yot+kBNgz/962D0KodAVxWNQh8nupExMObdvguLxk IByMYHgNs+dw2jDhoDk0dwcyjhp6oh0SDlw4Ss1hb6dL1NCPqGzCRRuULi9eWz95+8Zc eoaOgNC4xH64Ru4PtXhtHDVg2mAdYzF2vONZ2gX19siWSxO3FtbfPUQdW0D7BqMn39pL f2KG/SdiR4JNP31f8ysAUjS8Kc8k6HT+dmehdqmX1wLvIuivNjl8F4Bh99vv6PVqCHMN xX9A== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ISTYoMJEnegimPADJUJ8nKLyr/LGctvkYBNWYy3jyL0=; b=zWUoAAwr0GYOToyT+jOmJzvu+mmzTcySot+NsUc+Y/01ievxgJ39EH6GTOb7Yiad7X UFQXASOjKun5lJ94fUHMWNG2ouWP0cNf7qn2wIqZDk3GuFPcQsQID1X1s68oH2tnVAvh jiDFGfoyXdRxUCiUyc+PnZOzYC1yGpX9Q6zyF2Ty8JWoQ6x6sArtt1G4FknJ7kMsiGd5 +mZse9aI6Xk7fwImGPDyOI3KuWc71Pm3ePpiQ72IhjSlrXesUVELoMBJ0lLKsYiUFQQM /t3gHFJzxKuSI8t4I/aqN7MxRHPNCleykTDNREzY+DZN1hsV8AUpsAWsJx6fFA6BRJB1 ZYnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bDfsMatc; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y16-20020a056402359000b00446eebe9eebsi4873302edc.634.2022.08.24.04.12.43; Wed, 24 Aug 2022 04:13:10 -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=@intel.com header.s=Intel header.b=bDfsMatc; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235337AbiHXKcp (ORCPT + 99 others); Wed, 24 Aug 2022 06:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiHXKcn (ORCPT ); Wed, 24 Aug 2022 06:32:43 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9CD47E814; Wed, 24 Aug 2022 03:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661337162; x=1692873162; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=UArt2EM4pE0fPWswCENdaTr2KP04kl+6xHjnd6dPVIs=; b=bDfsMatcpT388oU11xyWAASlre+w97FZBiFfg51ZzsSv6cC0/ToF/AHP OoZok09KnuFtaKo0TyexRNMW6/agwVevHpesQftxLvx+Dk0TfvdqpJu8T QBTqYP8SOiyqr6KLW7iSjyyZIQyR8q5k9ajFYyibiJpVOLFLvmgOr4Y9G T+86G6sNp71SLPb35k8kQ7lAu33U+6KTf9zAGyiobZfghiSvQHCj/6j/C 6Y+lIkiqt/JiR+hme32jJ4iDiveGjQreUxh3RFxdPABnFKflDoqPJSpgN VY92WzUcq8w6vIIVyM+8Y+dBEYXTmFzkFXHYXMWDsuPw9ffdeFeCWwnH4 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10448"; a="355658596" X-IronPort-AV: E=Sophos;i="5.93,260,1654585200"; d="scan'208";a="355658596" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2022 03:32:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,260,1654585200"; d="scan'208";a="605987428" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.193.75]) by orsmga007.jf.intel.com with ESMTP; 24 Aug 2022 03:32:31 -0700 Date: Wed, 24 Aug 2022 18:27:48 +0800 From: Chao Peng To: Matthew Wilcox Cc: Hugh Dickins , "Kirill A . Shutemov" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, 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 , x86@kernel.org, "H . Peter Anvin" , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , "Gupta, Pankaj" Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory Message-ID: <20220824102748.GB1385482@chaop.bj.intel.com> Reply-To: Chao Peng References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220818132421.6xmjqduempmxnnu2@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Sun, Aug 21, 2022 at 11:27:44AM +0100, Matthew Wilcox wrote: > On Thu, Aug 18, 2022 at 08:00:41PM -0700, Hugh Dickins wrote: > > tmpfs and hugetlbfs and page cache are designed around sharing memory: > > TDX is designed around absolutely not sharing memory; and the further > > uses which Sean foresees appear not to need it as page cache either. > > > > Except perhaps for page migration reasons. It's somewhat incidental, > > but of course page migration knows how to migrate page cache, so > > masquerading as page cache will give a short cut to page migration, > > when page migration becomes at all possible. > > I haven't read the patch series, and I'm not taking a position one way > or the other on whether this is better implemented as a shmem addition > or a shim that asks shmem for memory. Page migration can be done for > driver memory by using PageMovable. I just rewrote how it works, so > the details are top of my mind at the moment if anyone wants something > explained. Commit 68f2736a8583 is the key one to look at. Thanks Matthew. That is helpful to understand the current code. Chao