Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2100775rwn; Fri, 9 Sep 2022 08:32:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR7KhQisGVdsZaIvQHM2f06q/rQr01jXYa+KM0HatYRpRkppRkn4p2Ur3tLk+WT2BF/4rqJO X-Received: by 2002:a17:906:5a4d:b0:76f:bb35:48f4 with SMTP id my13-20020a1709065a4d00b0076fbb3548f4mr9799731ejc.686.1662737510681; Fri, 09 Sep 2022 08:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662737510; cv=none; d=google.com; s=arc-20160816; b=fL4v16JL7WdvjAcD5EbP5qyNidEkT0RSXB5BtrdX6uCKY5vUDynoR263dxRqAhXmm7 orvxo9laBLdwZ3Ovzcel1gk5rWVRIR5FjMA4xGTiH/pQwXI1tEaTSvoEsu9nSinEdYEe vwZKceo1k9KNIeQVYiNpOHgXF54ik3Mytx9pr3vrB7Chh1Z+L2pi8bcMJf2nUjai92g0 uBhRrSJg48nWQGDdMJx9dM8BKP34dfH379VX6OrBmin5Sw1g/C6NWsjTVjLn6KrrORQw Z87QgRDIVdifaOepdFpLafMiXjZJN5Xo6YOm0lLMRqu1QE3e09KRX20cA3WniQSc0Rkh y8Yw== 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=7eQ6c9OOEqtzCY0Yg4B/x28wTNs9oFAldyymf4XsYbY=; b=DK91epmcf9fG9wxlFKNgGg6ORUVkwzkX74Ozzt0EwrghsX0O+S8wDolFx25j2WmSo7 ixBGg9u58eieiXKLiVe8+aKI4eyVOvQLTCBwlXUECfCNpfxTB2WIkRKX5uL100a3A533 THyIiSiEGwrMqFtudK1Xb2C/s9+Jk2pXrSyzv+GXKcYFP7X5B3uhjCdLpAGRKrnGygLr +JhRQd38iVuaVzXROhbMaKn8yrIytWkDBI2YY4CjXAtw4xajQ5hmoGGE9JTblJwY9FE5 +tRbq8A9zhGnNLtdPSNf+zsAv3i8CFwY5uT+xXnUH9RPB/hLC0VYO+yQBBNgTi5nh3f1 Hrtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YCNEJkUg; 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 l6-20020a056402124600b004467fff4228si638469edw.567.2022.09.09.08.31.23; Fri, 09 Sep 2022 08:31:50 -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=YCNEJkUg; 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 S231474AbiIIOdT (ORCPT + 99 others); Fri, 9 Sep 2022 10:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiIIOdO (ORCPT ); Fri, 9 Sep 2022 10:33:14 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3743FEB2D0; Fri, 9 Sep 2022 07:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662733993; x=1694269993; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=gVTNsSyIBrhcPs2gtAOglD6dY69wve4jHFwcbsEjqEg=; b=YCNEJkUgYMvWX8Ca4SiKVEusdseonO3G0U4IIfFgagOuXhrp5ATI+xoL clsCmxL2VpJTPd8Jf0S73lg35hTTeVQYfs0DE1DC4/9o3RdFew1Bb8Cfi r5Q1b8+O2G0OGmf1wDRoO123R9/AQAOzdjs8u8pQERZUwTZKIqEMBBN/N 3TLwrT++bDZY5bamSYL1XJhPdx028iyckiaOCjp/a+A1NPHa32X7gnLaM pBj0zjJPdsbItTxwtdxJ1wE0fd8JqPDsYqnrXwcaGZdFjui792kJezeH8 A5x2o6EI425Iui/OnAFkyq57g5wWuWugeHhU3LEeSUxbhUsJDqEu54izA g==; X-IronPort-AV: E=McAfee;i="6500,9779,10465"; a="295068205" X-IronPort-AV: E=Sophos;i="5.93,303,1654585200"; d="scan'208";a="295068205" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2022 07:32:48 -0700 X-IronPort-AV: E=Sophos;i="5.93,303,1654585200"; d="scan'208";a="757619409" Received: from sumitdes-mobl3.gar.corp.intel.com (HELO box.shutemov.name) ([10.249.45.93]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2022 07:32:39 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id ED94B1037A2; Fri, 9 Sep 2022 17:32:36 +0300 (+03) Date: Fri, 9 Sep 2022 17:32:36 +0300 From: "Kirill A . Shutemov" To: Andy Lutomirski Cc: "Kirill A. Shutemov" , Hugh Dickins , Chao Peng , 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 , 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: <20220909143236.sznwzkpedldrlnn5@box.shutemov.name> References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220818132421.6xmjqduempmxnnu2@box> <20220820002700.6yflrxklmpsavdzi@box.shutemov.name> <95bd287b-d17f-fda8-58c9-20700b1e0c72@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95bd287b-d17f-fda8-58c9-20700b1e0c72@kernel.org> X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE,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 Thu, Sep 08, 2022 at 09:48:35PM -0700, Andy Lutomirski wrote: > On 8/19/22 17:27, Kirill A. Shutemov wrote: > > On Thu, Aug 18, 2022 at 08:00:41PM -0700, Hugh Dickins wrote: > > > On Thu, 18 Aug 2022, Kirill A . Shutemov wrote: > > > > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > > > > > > > > > If your memory could be swapped, that would be enough of a good reason > > > > > to make use of shmem.c: but it cannot be swapped; and although there > > > > > are some references in the mailthreads to it perhaps being swappable > > > > > in future, I get the impression that will not happen soon if ever. > > > > > > > > > > If your memory could be migrated, that would be some reason to use > > > > > filesystem page cache (because page migration happens to understand > > > > > that type of memory): but it cannot be migrated. > > > > > > > > Migration support is in pipeline. It is part of TDX 1.5 [1]. And swapping > > > > theoretically possible, but I'm not aware of any plans as of now. > > > > > > > > [1] https://www.intel.com/content/www/us/en/developer/articles/technical/intel-trust-domain-extensions.html > > > > > > I always forget, migration means different things to different audiences. > > > As an mm person, I was meaning page migration, whereas a virtualization > > > person thinks VM live migration (which that reference appears to be about), > > > a scheduler person task migration, an ornithologist bird migration, etc. > > > > > > But you're an mm person too: you may have cited that reference in the > > > knowledge that TDX 1.5 Live Migration will entail page migration of the > > > kind I'm thinking of. (Anyway, it's not important to clarify that here.) > > > > TDX 1.5 brings both. > > > > In TDX speak, mm migration called relocation. See TDH.MEM.PAGE.RELOCATE. > > > > This seems to be a pretty bad fit for the way that the core mm migrates > pages. The core mm unmaps the page, then moves (in software) the contents > to a new address, then faults it in. TDH.MEM.PAGE.RELOCATE doesn't fit into > that workflow very well. I'm not saying it can't be done, but it won't just > work. Hm. From what I see we have all necessary infrastructure in place. Unmaping is NOP for inaccessible pages as it is never mapped and we have mapping->a_ops->migrate_folio() callback that allows to replace software copying with whatever is needed, like TDH.MEM.PAGE.RELOCATE. What do I miss? -- Kiryl Shutsemau / Kirill A. Shutemov