Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7152785ybl; Wed, 15 Jan 2020 16:39:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxD6+4NxfSAgEvJEVbDjkndq+/Sy1z+1ODtejXAvZrP3DMLbEg8ZBxnDB+qZG8IbbkTMddy X-Received: by 2002:a9d:7f11:: with SMTP id j17mr4917153otq.281.1579135139978; Wed, 15 Jan 2020 16:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579135139; cv=none; d=google.com; s=arc-20160816; b=IXq5bR0rFvdVqkaxwvJAgGKpXs/OHnKbRIUX5ZsTrsYrQdTe+CTNLgX4+mzWJEW3J+ 4vg45ISh4rdJLM7Msla5jyAdWQQA2cVF+BMpOfl6iyEiYePhlR/nDFDR3tUdKyyLbIkQ hPlsEirS1YTeyRma/uIkXRRnagR6tutu3WqSRe+y2E6DvRFlx3WRUmxgL2YKoFLYyPlv yK7KS1N/+uUBektHtijYy3+DzwJSsF928rGV4QAYBarfbQPhy65+fMjggr4z1g2l++FL GZCQrwP6OPCMgqQxXtaanpGhLTrcbKJNGQCAMEe2/2/uDvj3+DzOY4HN1pqoqsD9yJyi tSWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=pF8RwOp7f3FjsagsIQ2djxTwfv6Di9jVKY16CONFw48=; b=uKcg4gvprNPm5KDJpMn8ManfkzQuN7Fjea6RQgomblZV6iSD6Sm/VZii9o17psXuRV hatN1uFSfck1zqhf7SFajrsbKDlKUrqwx0JjUjiXOb+PKjJyLxqo1iXdoAAj/4z5gos3 yIkTBm4aVqerriMhMNnaxlSv5PeuE04Vfu2k+oOfIEKfbQ1KcmJEx5rF7lXMNHuL6wh0 r/MAVdy10USe66ZBlXVQu4G41q0+jvKpKfUSDSTk6FfsvTufR1uHHC5GliAFiyFZ8Mbu sH5oErmSYuMdYHc2xm9JsEyasY/ABqhVv+ANPaV5R8R4Ar3REmTJP5oykIHVIodQ90OG cEhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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. [209.132.180.67]) by mx.google.com with ESMTP id v23si11403749otk.321.2020.01.15.16.38.41; Wed, 15 Jan 2020 16:38:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1731104AbgAOXws (ORCPT + 99 others); Wed, 15 Jan 2020 18:52:48 -0500 Received: from mga06.intel.com ([134.134.136.31]:54823 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730572AbgAOXws (ORCPT ); Wed, 15 Jan 2020 18:52:48 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2020 15:52:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,323,1574150400"; d="scan'208";a="373102555" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga004.jf.intel.com with ESMTP; 15 Jan 2020 15:52:38 -0800 Date: Wed, 15 Jan 2020 15:52:37 -0800 From: Ira Weiny To: "Darrick J. Wong" Cc: linux-kernel@vger.kernel.org, Alexander Viro , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH V2 08/12] fs/xfs: Add lock/unlock mode to xfs Message-ID: <20200115235237.GA24522@iweiny-DESK2.sc.intel.com> References: <20200110192942.25021-1-ira.weiny@intel.com> <20200110192942.25021-9-ira.weiny@intel.com> <20200113221957.GN8247@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200113221957.GN8247@magnolia> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Jan 13, 2020 at 02:19:57PM -0800, Darrick J. Wong wrote: > On Fri, Jan 10, 2020 at 11:29:38AM -0800, ira.weiny@intel.com wrote: > > From: Ira Weiny > > [snip] > > > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > > index 401da197f012..e8fd95b75e5b 100644 > > --- a/fs/xfs/xfs_inode.c > > +++ b/fs/xfs/xfs_inode.c > > @@ -142,12 +142,12 @@ xfs_ilock_attr_map_shared( > > * > > * Basic locking order: > > * > > - * i_rwsem -> i_mmap_lock -> page_lock -> i_ilock > > + * i_rwsem -> i_dax_sem -> i_mmap_lock -> page_lock -> i_ilock > > Mmmmmm, more locks. Can we skip the extra lock if CONFIG_FSDAX=n or if > the filesystem devices don't support DAX at all? I've looked into this a bit more and I think skipping on CONFIG_FSDAX=n is ok but doing so on individual devices is not going to be possible because we don't have that information at the vfs layer. I'll continue to think about how to mitigate this more while I add CONFIG_FSDAX checks before rolling out a new patch set. > > Also, I don't think we're actually following the i_rwsem -> i_daxsem > order in fallocate, and possibly elsewhere too? > > Does the vfs have to take the i_dax_sem to do remapping things like > reflink? (Pretend that reflink and dax are compatible for the moment) > I spoke with Dan today about this and we believe the answer is going to be yes. However, not until the code is added to support DAX in reflink. Because currently this is only required for places which use "IS_DAX()" to see the state of the inode. Currently the vfs layer does not have any IS_DAX() checks in the reflink path. But when they are added they will be required to take this sem. Ira