On Mon, Mar 07, 2022 at 04:42:08PM +0100, Vlastimil Babka wrote: > On 1/18/22 14:21, Chao Peng wrote: > > This patch introduces memfile_notifier facility so existing memory file > > subsystems (e.g. tmpfs/hugetlbfs) can provide memory pages to allow a > > third kernel component to make use of memory bookmarked in the memory > > file and gets notified when the pages in the memory file become > > allocated/invalidated. > > > > It will be used for KVM to use a file descriptor as the guest memory > > backing store and KVM will use this memfile_notifier interface to > > interact with memory file subsystems. In the future there might be other > > consumers (e.g. VFIO with encrypted device memory). > > > > It consists two sets of callbacks: > > - memfile_notifier_ops: callbacks for memory backing store to notify > > KVM when memory gets allocated/invalidated. > > - memfile_pfn_ops: callbacks for KVM to call into memory backing store > > to request memory pages for guest private memory. > > > > Userspace is in charge of guest memory lifecycle: it first allocates > > pages in memory backing store and then passes the fd to KVM and lets KVM > > register each memory slot to memory backing store via > > memfile_register_notifier. > > > > The supported memory backing store should maintain a memfile_notifier list > > and provide routine for memfile_notifier to get the list head address and > > memfile_pfn_ops callbacks for memfile_register_notifier. It also should call > > memfile_notifier_fallocate/memfile_notifier_invalidate when the bookmarked > > memory gets allocated/invalidated. > > > > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> > > Process nitpick: > Here and in patch 4/12 you have Kirill's S-o-b so there should probably be > also "From: Kirill ..." as was in v3? Or in case you modified the original > patches so much to become the primary author, you should add > "Co-developed-by: Kirill ..." here before his S-o-b. Thanks. 3/12 is vastly rewritten so the latter case can be applied. 4/12 should keep Kirill as the primary author. Chao