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 AEA30C433F5 for ; Tue, 8 Mar 2022 01:46:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24FD48D0002; Mon, 7 Mar 2022 20:46:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FF298D0001; Mon, 7 Mar 2022 20:46:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C8708D0002; Mon, 7 Mar 2022 20:46:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id F07838D0001 for ; Mon, 7 Mar 2022 20:46:11 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B89683EA for ; Tue, 8 Mar 2022 01:46:11 +0000 (UTC) X-FDA: 79219528542.04.BF08541 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf12.hostedemail.com (Postfix) with ESMTP id A264D40005 for ; Tue, 8 Mar 2022 01:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646703970; x=1678239970; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=mHBCi6qAEBh/nnklYLjjX0eLK1S8y5VX77Z1SPbc3yQ=; b=ULmH3UEBLdccUYzQgIXK0dw+/n2E3nyWqtarEdlbrhI/qPGrgDozMej3 XODS3M2TAfukAkmK28C/7WUE0m1FhZjKGwWOTFcwYncWUriBNuf861Ulf iUyHGFEzYSzu3RuSaZoVHJPydGtvyptuDeqiiJV/dHXEEM8dXiCigeN4k 21t2qgVVI4kp+GcymcBYFJOgQVmLRTk204HJtYUamYpzzVCivVu+UDlse GCL/Uk+aGnFehCVIXjUnXei17+5UOF35VCeP4KvKm+F61+qcCCQHVj5Lb o4tcvZwbTSsawDGzU0RQ7xla5jUUDx8PeI7/GkFpW4lAUfXrDClF5GKrs w==; X-IronPort-AV: E=McAfee;i="6200,9189,10279"; a="254287691" X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="254287691" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 17:46:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="495276231" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.192.101]) by orsmga003.jf.intel.com with ESMTP; 07 Mar 2022 17:46:02 -0800 Date: Tue, 8 Mar 2022 09:45:45 +0800 From: Chao Peng To: Vlastimil Babka Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, qemu-devel@nongnu.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" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com Subject: Re: [PATCH v4 03/12] mm: Introduce memfile_notifier Message-ID: <20220308014545.GA43625@chaop.bj.intel.com> Reply-To: Chao Peng References: <20220118132121.31388-1-chao.p.peng@linux.intel.com> <20220118132121.31388-4-chao.p.peng@linux.intel.com> <9ac9a88f-54b4-a49f-0857-c3094d3e0d2b@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ac9a88f-54b4-a49f-0857-c3094d3e0d2b@suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: A264D40005 X-Stat-Signature: wucjhxu5h3fwuqmkbsrpdsn4rwuqz3bd Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ULmH3UEB; spf=none (imf12.hostedemail.com: domain of chao.p.peng@linux.intel.com has no SPF policy when checking 134.134.136.24) smtp.mailfrom=chao.p.peng@linux.intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-HE-Tag: 1646703970-648609 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 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 > > 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