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 1AF97C433FE for ; Fri, 31 Dec 2021 02:39:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E8A26B0099; Thu, 30 Dec 2021 21:39:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 697D86B009A; Thu, 30 Dec 2021 21:39:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5605A6B009B; Thu, 30 Dec 2021 21:39:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id 45F876B0099 for ; Thu, 30 Dec 2021 21:39:41 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EE20487CB5 for ; Fri, 31 Dec 2021 02:39:40 +0000 (UTC) X-FDA: 78976533720.20.D58DC91 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf16.hostedemail.com (Postfix) with ESMTP id 2E7BD180004 for ; Fri, 31 Dec 2021 02:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640918380; x=1672454380; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=TzNuTr+rkRfs/siMv5ThwCQ6SRkD7qmXiB7orZOuuAY=; b=VPrWTb+foiV/kGIk2+R9bqk4ufFUr9dTl27aAmUobrEMAUneYlPn0+ib BOvZ3ONwJEVKhLD7ClYbLxx6LZ+vdykkpbB70dRNiB4lVOLyoElVt3UjY IjJL1KfUuwGgqWmWD2sQohxVMOEozAR5/DqkyPlsp2T078I7/mN1Abk9W g6Up27QTo+otmn0rfBQGZGEq0Og/hVNVq4hRwJLYENcrh+Hr1qiDFMjTZ y9qIHympKNcWi9YU+PhaPHMM4Rp/BTzJmaFFqIN8n9JlstzILLT80PWD6 rw6lU/ABkExj1cwqrt5v34IEwHq89jxulGQH1qwnoztyuSjjXqfC+KNJp Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10213"; a="228587207" X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="228587207" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2021 18:39:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,250,1635231600"; d="scan'208";a="666708085" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.192.101]) by fmsmga001.fm.intel.com with ESMTP; 30 Dec 2021 18:39:29 -0800 Date: Fri, 31 Dec 2021 10:38:53 +0800 From: Chao Peng To: Robert Hoo 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, john.ji@intel.com, susie.li@intel.com, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com Subject: Re: [PATCH v3 kvm/queue 03/16] mm/memfd: Introduce MEMFD_OPS Message-ID: <20211231023853.GB7255@chaop.bj.intel.com> Reply-To: Chao Peng References: <20211223123011.41044-1-chao.p.peng@linux.intel.com> <20211223123011.41044-4-chao.p.peng@linux.intel.com> <95d13ac7da32aa1530d6883777ef3279e4ad825d.camel@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <95d13ac7da32aa1530d6883777ef3279e4ad825d.camel@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=VPrWTb+f; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf16.hostedemail.com: domain of chao.p.peng@linux.intel.com has no SPF policy when checking 134.134.136.126) smtp.mailfrom=chao.p.peng@linux.intel.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2E7BD180004 X-Stat-Signature: 1modaojr8oj5pgz71zfrk7hpdq7bxh8a X-HE-Tag: 1640918379-874201 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 Fri, Dec 24, 2021 at 11:53:15AM +0800, Robert Hoo wrote: > On Thu, 2021-12-23 at 20:29 +0800, Chao Peng wrote: > > From: "Kirill A. Shutemov" > > > > +static void notify_fallocate(struct inode *inode, pgoff_t start, > > pgoff_t end) > > +{ > > +#ifdef CONFIG_MEMFD_OPS > > + struct shmem_inode_info *info = SHMEM_I(inode); > > + const struct memfd_falloc_notifier *notifier; > > + void *owner; > > + bool ret; > > + > > + if (!info->falloc_notifier) > > + return; > > + > > + spin_lock(&info->lock); > > + notifier = info->falloc_notifier; > > + if (!notifier) { > > + spin_unlock(&info->lock); > > + return; > > + } > > + > > + owner = info->owner; > > + ret = notifier->get_owner(owner); > > + spin_unlock(&info->lock); > > + if (!ret) > > + return; > > + > > + notifier->fallocate(inode, owner, start, end); > > I see notifier->fallocate(), i.e. memfd_fallocate(), discards > kvm_memfd_fallocate_range()'s return value. Should it be checked? I think we can ignore it, just like how current mmu_notifier does, the return value of __kvm_handle_hva_range is discarded in kvm_mmu_notifier_invalidate_range_start(). Even when KVM side failed, it's not fatal, it should not block the operation in the primary MMU. Thanks, Chao > > > + notifier->put_owner(owner); > > +#endif > > +} > > +