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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3EBDC43461 for ; Tue, 27 Apr 2021 16:34:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF24861182 for ; Tue, 27 Apr 2021 16:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237040AbhD0QfL (ORCPT ); Tue, 27 Apr 2021 12:35:11 -0400 Received: from mga06.intel.com ([134.134.136.31]:7390 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236572AbhD0QfK (ORCPT ); Tue, 27 Apr 2021 12:35:10 -0400 IronPort-SDR: HYRBlxVa1vrEPy+SPu0HGOHo217i1v6Yl+w9Z2c+pbzQqNqfrYGNuYLQp2fZLNn0BS6irPJ2ld RKb0la7tLlTQ== X-IronPort-AV: E=McAfee;i="6200,9189,9967"; a="257849526" X-IronPort-AV: E=Sophos;i="5.82,254,1613462400"; d="scan'208";a="257849526" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 09:34:26 -0700 IronPort-SDR: 56D78GrkzT0gyka0rNNSqxAB64SKTQBfDo09R45Rx5juh+b57u47vkvt8mJ1A0sUvLEYL9+9Ep DD9gzPzKoa8w== X-IronPort-AV: E=Sophos;i="5.82,254,1613462400"; d="scan'208";a="429877058" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 09:34:26 -0700 Date: Tue, 27 Apr 2021 09:34:26 -0700 From: Ira Weiny To: "ruansy.fnst@fujitsu.com" Cc: "linux-kernel@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "linux-fsdevel@vger.kernel.org" , "darrick.wong@oracle.com" , "dan.j.williams@intel.com" , "willy@infradead.org" , "jack@suse.cz" , "viro@zeniv.linux.org.uk" , "linux-btrfs@vger.kernel.org" , "david@fromorbit.com" , "hch@lst.de" , "rgoldwyn@suse.de" , Ritesh Harjani Subject: Re: [PATCH v3 1/3] fsdax: Factor helpers to simplify dax fault code Message-ID: <20210427163425.GW1904484@iweiny-DESK2.sc.intel.com> References: <20210422134501.1596266-1-ruansy.fnst@fujitsu.com> <20210422134501.1596266-2-ruansy.fnst@fujitsu.com> <20210426233823.GT1904484@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Tue, Apr 27, 2021 at 02:44:33AM +0000, ruansy.fnst@fujitsu.com wrote: > > -----Original Message----- > > From: Ira Weiny > > Sent: Tuesday, April 27, 2021 7:38 AM > > Subject: Re: [PATCH v3 1/3] fsdax: Factor helpers to simplify dax fault code > > > > On Thu, Apr 22, 2021 at 09:44:59PM +0800, Shiyang Ruan wrote: > > > The dax page fault code is too long and a bit difficult to read. And > > > it is hard to understand when we trying to add new features. Some of > > > the PTE/PMD codes have similar logic. So, factor them as helper > > > functions to simplify the code. > > > > > > Signed-off-by: Shiyang Ruan > > > Reviewed-by: Christoph Hellwig > > > Reviewed-by: Ritesh Harjani > > > --- > > > fs/dax.c | 153 > > > ++++++++++++++++++++++++++++++------------------------- > > > 1 file changed, 84 insertions(+), 69 deletions(-) > > > > > > diff --git a/fs/dax.c b/fs/dax.c > > > index b3d27fdc6775..f843fb8fbbf1 100644 > > > --- a/fs/dax.c > > > +++ b/fs/dax.c > > > > [snip] > > > > > @@ -1355,19 +1379,8 @@ static vm_fault_t dax_iomap_pte_fault(struct > > vm_fault *vmf, pfn_t *pfnp, > > > entry = dax_insert_entry(&xas, mapping, vmf, entry, pfn, > > > 0, write && !sync); > > > > > > - /* > > > - * If we are doing synchronous page fault and inode needs fsync, > > > - * we can insert PTE into page tables only after that happens. > > > - * Skip insertion for now and return the pfn so that caller can > > > - * insert it after fsync is done. > > > - */ > > > if (sync) { > > > - if (WARN_ON_ONCE(!pfnp)) { > > > - error = -EIO; > > > - goto error_finish_iomap; > > > - } > > > - *pfnp = pfn; > > > - ret = VM_FAULT_NEEDDSYNC | major; > > > + ret = dax_fault_synchronous_pfnp(pfnp, pfn); > > > > I commented on the previous version... So I'll ask here too. > > > > Why is it ok to drop 'major' here? > > This dax_iomap_pte_fault () finally returns 'ret | major', so I think the major here is not dropped. The origin code seems OR the return value and major twice. > Thanks I missed that! Ira