Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4837553ybb; Tue, 14 Apr 2020 15:16:45 -0700 (PDT) X-Google-Smtp-Source: APiQypK0hBiJc03wf8EqZCxDeWAjmDJpBlUXn7FS8cmia8YtsztU1ihYC4kcLWTzNxCciybO2hqQ X-Received: by 2002:a17:906:4482:: with SMTP id y2mr2218868ejo.234.1586902604839; Tue, 14 Apr 2020 15:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586902604; cv=none; d=google.com; s=arc-20160816; b=TnE+DbwFs6rKeFXM0RFpAROaNosVw44HnPm/tHzW79n654EsYwCHXLtntHnyZaJV9x j6+S8rpUXRZZquk6I8EBe+2zIpRrMjUN/6XuPbU6iubAYtchst8Kc7uEiERXI8YC/feT rCsxhqe3VNSYMp7Oq79RA2KSGSCRDgQac775EfYk0zzEwxHIvL4xF5WA0lL4p9Am9iHn VPk0mlorKUztoeRV58XWzsxLFYldrf4Ofu7PSM3u822lx8zM3CjWGhjDzNL+jiehiM0k 6C5xYOK+bp9A9xTtymkD4fRb6tRPHrHEZHCIJEs4r6FDnymzrkD4HAeuxpjdJGe6cpkk lQbA== 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:ironport-sdr:ironport-sdr; bh=ZSxuiXRLQCowjsrG/g2JDDzeZe+WHNVp6T+fo0yV2iM=; b=kuWW7eKRf7XX5sfuKg6He58xXPIpDoi1PlvmzBNGoRD9FkuxsHZoIoKzum/KwQAhCj YAq8/YJKzPV2nzYvtlmDTHSgtxg0fHbWAjA4Ve7exdbwxHhOykquSKM6wMHgFzWBKzi/ hjpkV14QbBFhF/RUlJtFRvPON/FluEgbMujux6Ou3jb9nwxCaYXL3aLUEbje0D05tgLm R4UFSEtWq1/WroBAFwu6h1E0vouEiGF3qpuhWnoCXZLOVwBXTidKEn2WhrSJd8XNA+TX MBfrCsTTFz+E2Saa9yW3VzXUObu8Wg3Odo1xFkzAs5p0qGTr+WWAdO2UYgLcjP5xGPxY P7yA== 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 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ch13si9029994ejb.338.2020.04.14.15.16.18; Tue, 14 Apr 2020 15:16:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 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 S2388050AbgDMToe (ORCPT + 99 others); Mon, 13 Apr 2020 15:44:34 -0400 Received: from mga14.intel.com ([192.55.52.115]:29540 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388034AbgDMToe (ORCPT ); Mon, 13 Apr 2020 15:44:34 -0400 IronPort-SDR: Ae2xt0TSgl1+VtNBnJm1r1VQfZsEIvN07r3gehnhzZAmsi2zfYsfM3u8A0Ft3KGcmrI1CQJCtp TBS5JqkT5Guw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 12:44:33 -0700 IronPort-SDR: v+q6zP5bKPmHA88y6ZiO81BAf42afIm8n0sGOl7dCToUlDBSth6eGFpgqbf2PNOyTnsccQEh+U NlVotKwkBJsQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,380,1580803200"; d="scan'208";a="256275264" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by orsmga006.jf.intel.com with ESMTP; 13 Apr 2020 12:44:32 -0700 Date: Mon, 13 Apr 2020 12:44:32 -0700 From: Ira Weiny To: "Darrick J. Wong" Cc: linux-kernel@vger.kernel.org, Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , Jeff Moyer , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH V7 7/9] fs: Define I_DONTCACNE in VFS layer Message-ID: <20200413194432.GD1649878@iweiny-DESK2.sc.intel.com> References: <20200413054046.1560106-1-ira.weiny@intel.com> <20200413054046.1560106-8-ira.weiny@intel.com> <20200413160929.GW6742@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200413160929.GW6742@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, Apr 13, 2020 at 09:09:29AM -0700, Darrick J. Wong wrote: > > Subject: [PATCH V7 7/9] fs: Define I_DONTCACNE in VFS layer > > CACNE -> CACHE. > > On Sun, Apr 12, 2020 at 10:40:44PM -0700, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > DAX effective mode changes (setting of S_DAX) require inode eviction. > > > > Define a flag which can be set to inform the VFS layer that inodes > > should not be cached. This will expedite the eviction of those nodes > > requiring reload. > > > > Signed-off-by: Ira Weiny > > --- > > include/linux/fs.h | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/include/linux/fs.h b/include/linux/fs.h > > index a818ced22961..e2db71d150c3 100644 > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -2151,6 +2151,8 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src, > > * > > * I_CREATING New object's inode in the middle of setting up. > > * > > + * I_DONTCACHE Do not cache the inode > > "Do not cache" is a bit vague, how about: > > "Evict the inode when the last reference is dropped. > Do not put it on the LRU list." > > Also, shouldn't xfs_ioctl_setattr be setting I_DONTCACHE if someone > changes FS_XFLAG_DAX (and there are no mount option overrides)? I don't > see any user of I_DONTCACHE in this series. > > (Also also, please convert XFS_IDONTCACHE, since it's a straightforward > conversion...) AFAICT XFS_IDONTCACHE is not exactly the same because it can be cleared if someone access' the inode before it is evicted. Dave mentioned that we could probably do this but I was not 100% sure if that would change some other behavior. I'm happy to remove XFS_IDONTCACHE if we are sure that it will not regress something in the bulkstat code? (I don't know exactly what bulkstat does so I'm not expert here... Was just doing what seemed safest) Ira > > --D > > > + * > > * Q: What is the difference between I_WILL_FREE and I_FREEING? > > */ > > #define I_DIRTY_SYNC (1 << 0) > > @@ -2173,6 +2175,7 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src, > > #define I_WB_SWITCH (1 << 13) > > #define I_OVL_INUSE (1 << 14) > > #define I_CREATING (1 << 15) > > +#define I_DONTCACHE (1 << 16) > > > > #define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC) > > #define I_DIRTY (I_DIRTY_INODE | I_DIRTY_PAGES) > > @@ -3042,7 +3045,8 @@ extern int inode_needs_sync(struct inode *inode); > > extern int generic_delete_inode(struct inode *inode); > > static inline int generic_drop_inode(struct inode *inode) > > { > > - return !inode->i_nlink || inode_unhashed(inode); > > + return !inode->i_nlink || inode_unhashed(inode) || > > + (inode->i_state & I_DONTCACHE); > > } > > > > extern struct inode *ilookup5_nowait(struct super_block *sb, > > -- > > 2.25.1 > >