[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74097857-1908-2ff2-1e54-bf7e658ea6c6@amd.com>
Date: Wed, 13 Jul 2022 12:01:13 +0200
From: "Gupta, Pankaj" <pankaj.gupta@....com>
To: Chao Peng <chao.p.peng@...ux.intel.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
linux-api@...r.kernel.org, linux-doc@...r.kernel.org,
qemu-devel@...gnu.org, linux-kselftest@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Jonathan Corbet <corbet@....net>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H . Peter Anvin" <hpa@...or.com>,
Hugh Dickins <hughd@...gle.com>,
Jeff Layton <jlayton@...nel.org>,
"J . Bruce Fields" <bfields@...ldses.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>, Mike Rapoport <rppt@...nel.org>,
Steven Price <steven.price@....com>,
"Maciej S . Szmigiero" <mail@...iej.szmigiero.name>,
Vlastimil Babka <vbabka@...e.cz>,
Vishal Annapurve <vannapurve@...gle.com>,
Yu Zhang <yu.c.zhang@...ux.intel.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
luto@...nel.org, jun.nakajima@...el.com, dave.hansen@...el.com,
ak@...ux.intel.com, david@...hat.com, aarcange@...hat.com,
ddutile@...hat.com, dhildenb@...hat.com,
Quentin Perret <qperret@...gle.com>,
Michael Roth <michael.roth@....com>, mhocko@...e.com,
Muchun Song <songmuchun@...edance.com>
Subject: Re: [PATCH v7 04/14] mm/shmem: Support memfile_notifier
>>> +#ifdef CONFIG_MIGRATION
>>> +static int shmem_migrate_page(struct address_space *mapping,
>>> + struct page *newpage, struct page *page,
>>> + enum migrate_mode mode)
>>> +{
>>> + struct inode *inode = mapping->host;
>>> + struct shmem_inode_info *info = SHMEM_I(inode);
>>> +
>>> + if (info->memfile_node.flags & MEMFILE_F_UNMOVABLE)
>>> + return -EOPNOTSUPP;
>>> + return migrate_page(mapping, newpage, page, mode);
>>
>> Wondering how well page migrate would work for private pages
>> on shmem memfd based backend?
>
> From high level:
> - KVM unset MEMFILE_F_UNMOVABLE bit to indicate it capable of
> migrating a page.
> - Introduce new 'migrate' callback(s) to memfile_notifier_ops for KVM
> to register.
> - The callback is hooked to migrate_page() here.
> - Once page migration requested, shmem calls into the 'migrate'
> callback(s) to perform additional steps for encrypted memory (For
> TDX we will call TDH.MEM.PAGE.RELOCATE).
Yes, that would require additional (protocol specific) handling for
private pages. Was trying to find where "MEMFILE_F_UNMOVABLE" flag is
set currently?
Thanks,
Pankaj
Powered by blists - more mailing lists