Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp638547ybz; Wed, 15 Apr 2020 15:41:50 -0700 (PDT) X-Google-Smtp-Source: APiQypJoEFA/LmCKwTSM5stQNjrJGqvL6FB3dZkrHzkLoUCHyLWKV2JjJOwbxS1BdPWHbGzZ1nx4 X-Received: by 2002:a05:6402:284:: with SMTP id l4mr28154071edv.353.1586990510798; Wed, 15 Apr 2020 15:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586990510; cv=none; d=google.com; s=arc-20160816; b=H27/M6E1C6zGg1zA74grAzzMCLbxlVZfWLstJO04cHWUXAVZg9UX7aRUz96XSmrHXX WrB78ksmAM8jKAO9FK9p0K8tXCkdkvc3TjRMBegCda55jYJWz7AXKuEOBgvfZoCCi/EC 8HiMoQFkONRIZt88yCogg+v6D+YAl6Hs5eOkXyFcwxT+/jkNn7RtdNoBZ6bJOkq9bXf+ 1rGDgFRX4KcpzQFzXntzRvdyOoo5ZM8pSQ83lRzGGwNEd2sY40959Lzbva09cO5sOwHT ycAuGsHXxefm09GfeFG/fYeWuKjwHZN6Ol+h5suGtHNwVb5I49hGY4cMztG7vk+YLiZh B+uA== 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=H2BxeJs7vNOTW+SKYATLPuNKyd4Kgo5b/M6qWSahXLI=; b=HYJS6tmAOaZw46pGMoDls2peyHQ8Vbz3V4G2NsR+VcSkg7hO6muwF9jv+W2hSab0lO 3jUtN/BpV4zXbwhl4V/kZZv1nhIftkBhgVRPvBz+8TsYT6Hold2dieUsaZ1lSiM33dw/ pjvhB36HSnE5M0phhSHluSo5ZakQYHoaXNUn62uwtg7OIKmSSPkqTBnNKV8i/zE04yj5 Lhw5N3bioaFlqrViqBy0Xk4HCFgOrW6iwjB8z1FmM3E32lyUchVq+yrdYT3Krts8UFC0 gHQ8ZeFhpEBHx2l1SyiwnYT2tSc9/qz27ht4LSsnUGHX0kRreSqtHqrS3hGO3JaRt+hW Pj8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si11245620ejw.237.2020.04.15.15.41.25; Wed, 15 Apr 2020 15:41:50 -0700 (PDT) Received-SPF: pass (google.com: 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: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2895143AbgDOIwd (ORCPT + 99 others); Wed, 15 Apr 2020 04:52:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:47854 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505548AbgDOIwU (ORCPT ); Wed, 15 Apr 2020 04:52:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 58DA8AFB1; Wed, 15 Apr 2020 08:52:16 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 2D9361E1250; Wed, 15 Apr 2020 10:52:16 +0200 (CEST) Date: Wed, 15 Apr 2020 10:52:16 +0200 From: Jan Kara To: ira.weiny@intel.com Cc: linux-kernel@vger.kernel.org, "Darrick J. Wong" , Jan Kara , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jeff Moyer , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH V8 08/11] fs: Define I_DONTCACNE in VFS layer Message-ID: <20200415085216.GE501@quack2.suse.cz> References: <20200415064523.2244712-1-ira.weiny@intel.com> <20200415064523.2244712-9-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415064523.2244712-9-ira.weiny@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org There's a typo in the subject - I_DONTCACNE. On Tue 14-04-20 23:45:20, 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 > + * Maybe, I'd be more specific here and write: "Evict inode as soon as it is not used anymore"? Otherwise the patch looks good to me so feel free to add: Reviewed-by: Jan Kara Also it would be good to CC Al Viro on this one (and the dentry flag) I guess. Honza > * 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 > -- Jan Kara SUSE Labs, CR