Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4384213ybb; Tue, 14 Apr 2020 06:19:27 -0700 (PDT) X-Google-Smtp-Source: APiQypIe6tGvq3gwZBUxkpqQAI5o5fRY4r2XmZ1OgiuewP86iB7N2xjqNR2Tp1uzvJyPDEsb88NZ X-Received: by 2002:a17:906:855a:: with SMTP id h26mr103564ejy.56.1586870367231; Tue, 14 Apr 2020 06:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586870367; cv=none; d=google.com; s=arc-20160816; b=tXtB/KxQAK3NXboixStvROKd+2fiu+LD2cW2xuATUUMVke3gUqHTkUooZQSD/oireT JfY/FZHyQ5sdtBBXp5bj16faE69opeZwKg20uju/akPuEe/I32bkJU3X4RXYbUjVaqOq o2xfc7u/uOW8q6/BYh7mRDYRR5O+KoQU7O6qf+ZDI3xuz+Af3XWUzPRDXCOe2HGSPn6W 5CrQf4++f89hdyIKfX/j+uPt1NxYk9eSfp9OCVaIebdBqF6ZWpCh2iDZTrFkbSY/Zl5x gYpw5QUw7N/ecUZxSF6AjRdu8NWkEz6YsaMzbGMEj2FUXL6+u3bAVZGot3zzWHujtqFZ td5A== 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:dkim-signature; bh=gTpdQ7brV0CXW9TKkJBCTpkqnmMdP1WycvItcKLGQA8=; b=cbnHDxdmvOat4Etbqxs/trUEdO3bMGMOMwnrMu4KIFs9YEyJESOqg9ADFvPHz0At85 IkCblCjHGh4lt9ASWVehub9f0GQPJ9ch+inghSAF8qPjylvR5xPNdYZHFss9rQfJkW68 7JEJKAWQ1E0s5PBgaRHz2p7DktJB9wivFpf1+5e2mcYkyQocGfrxMgCPgRgZg3JokWBA bdM4KQZfxjan54TagyyKVAB5NCi1iBU8MDd63W/NPfyDt/Ow2ej+dCXoK2UbrLY0GwgM Z5Thm3ELQovMzhe4mmeWVk/qOdT4QXywnS6s3vtIwFVrjW1x0yZAYXtfqnv1i7hQP2A7 vmqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ZAafVRBL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si8528818edf.5.2020.04.14.06.19.03; Tue, 14 Apr 2020 06:19:27 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=ZAafVRBL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731284AbgDMQLr (ORCPT + 99 others); Mon, 13 Apr 2020 12:11:47 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:51916 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731261AbgDMQLr (ORCPT ); Mon, 13 Apr 2020 12:11:47 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03DGAb2G021669; Mon, 13 Apr 2020 16:11:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=gTpdQ7brV0CXW9TKkJBCTpkqnmMdP1WycvItcKLGQA8=; b=ZAafVRBLK7X7Sp8NzHvZLvS86o+qGFodFSQsJcpgeoNlBUy+UWdQcbMou9XX6q42e9Wf NCjjrvWsu+EiE/Ep50R3NnBPftQSTr9Xkgj4ZhiC097Zm1EjW5oCQBaUaTqYuopUOH5j zlNPrPMIoMjPN2zE3PVoAqb+RbhcbHxU817nVWdxinMLg0DYNRRasS8wk/n9TTWWQyYa h66QuHEte0um8xr3j23SaTK8LNTaMqGBuBPt+Q0iuOysEgXsFCKE8chEylXi3jKQVNTD dSGA1VQNlHDx4H1GasQ75kEuKirdlnAdxRCi4WGv3q/yPa2nN0IzzghrzlMGuDfDVm2l 4A== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 30b5aqyema-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Apr 2020 16:11:34 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03DG72bp181719; Mon, 13 Apr 2020 16:09:34 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 30bqkxmwfw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Apr 2020 16:09:33 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 03DG9WTP028583; Mon, 13 Apr 2020 16:09:32 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Apr 2020 09:09:31 -0700 Date: Mon, 13 Apr 2020 09:09:29 -0700 From: "Darrick J. Wong" To: ira.weiny@intel.com 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: <20200413160929.GW6742@magnolia> References: <20200413054046.1560106-1-ira.weiny@intel.com> <20200413054046.1560106-8-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200413054046.1560106-8-ira.weiny@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=3 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004130123 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 suspectscore=3 adultscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004130123 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > 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...) --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 >