From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com ([66.111.4.26]:57441 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933204AbdHYPKJ (ORCPT ); Fri, 25 Aug 2017 11:10:09 -0400 Message-Id: <1503673803.2650168.1084953360.73C357C4@webmail.messagingengine.com> From: Colin Walters To: Jan Kara , "Wangkai (Kevin,C)" Cc: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, Waiman Long , "Renjinyong (Renjinyong, Business Support Dept)" , Linus Torvalds MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" In-Reply-To: <20170825144702.GB6758@quack2.suse.cz> References: <1502099673-31620-1-git-send-email-wangkai86@huawei.com> <87B246BB5ED53A4C98E4F9A35839EDE18539C199@nkgeml514-mbx.china.huawei.com> <20170825144702.GB6758@quack2.suse.cz> Date: Fri, 25 Aug 2017 11:10:03 -0400 Subject: Re: [PATCH] fs/dcache: dentries should free after files unlinked or directories removed Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Aug 25, 2017, at 10:47 AM, Jan Kara wrote: > > It is possible that some of these dentries are so rarely used that they are > indeed just a waste In some cases - think containers, or ostree-style root filesystem snapshots, if we do an `rm -rf /path/to/container-root`, userspace knows for a fact that nothing will reference those paths again - all of the processes that could have been killed. There's no point to having negative dentries for them. Maybe something like unlinkat (dfd, path, AT_UNLINKAT_DONTNEED), like madvise (MAV_DONTNEED) ?