Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4652370pxy; Tue, 27 Apr 2021 09:36:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAqHYeU6twbdkNfzexD0LnCbtNPKSVEYN4bQreDtL+Z52IOqrEs/hHB1Pr6NndT105f5Hh X-Received: by 2002:a05:6402:6cd:: with SMTP id n13mr3398122edy.330.1619541379585; Tue, 27 Apr 2021 09:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619541379; cv=none; d=google.com; s=arc-20160816; b=FsZJlCjdGiAgk+wVg+bHDSNzpFECejzY4DiITZdePSZnWIT6AInqDxJOtgxCAKHlTU /PYYNU9B7ZvLRZ3kRR/PhnBvknm8Q89yUzOhPCPKJuVTVM+auuuPlA/+9xu6m6gPB04O K3dJv3OdZpx6ucgLrxVZPrOrx/eb2VMHJugXQxdZTk9H1ZhQrfLaFqUjWsbFUpkKNGa2 Wvma6fXC+Zy9YYYuf38Krwfh5k4kXi8oi24R1biQUt9DXhvTXtj4fE+POHFoz5ik9nWt BzQXM1qNrhmpTTVR+mEniSS4MQg+shT9Bd8XOt+2JYUEDS9eF4NinxlP2mQ4QGSrlAb2 halA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=oB+IZJwso7yPtsmDg6WXY7MlLr/4cd03P2M+7E6+mQc=; b=qGsdJU+PyxkZoQa2oJDERb4t/oJNcKx3O2NH/RhARoiYgRGZbyNeEIbB60Klfutu58 /mb88tBs6gasOj7xRuI1pgswdNMqTEDO3f8kVz55LZU4+hExKkESpAcR2p7CK0t7Om63 YDtOGnpUzKXWSYI+MHRRbZVMIZkv54u9HZAHKOHmLqF3RtJODDvtooyMrR92taLTs7Mh uD3ee9SjypbvVuI+a5FBC/FXZkkP5mFkJV6GykMqnSfZZ+wt5qDBNr7SBdPILEtCh4Fw 4SeB14xfdjZ39vg23nFM5RS517YC0fMAzyZJ/FMJGxLX1olhIfG7S78/oM4YF0iZ+daB grDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j19si323680ejc.617.2021.04.27.09.35.55; Tue, 27 Apr 2021 09:36:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237387AbhD0QfM (ORCPT + 99 others); Tue, 27 Apr 2021 12:35:12 -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-kernel@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