From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752888AbdHROKX (ORCPT ); Fri, 18 Aug 2017 10:10:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55560 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752484AbdHROKU (ORCPT ); Fri, 18 Aug 2017 10:10:20 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 742EC4ACC7 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=longman@redhat.com Subject: Re: [PATCH v3 0/5] fs/dcache: Limit # of negative dentries To: "Wangkai (Kevin,C)" , Alexander Viro , Jonathan Corbet Cc: "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "Paul E. McKenney" , Andrew Morton , Ingo Molnar , Miklos Szeredi , Matthew Wilcox , Larry Woodman , James Bottomley References: <1501266880-26288-1-git-send-email-longman@redhat.com> <1cdfb670-42ed-f8f6-aeab-c38ea0567651@redhat.com> <87B246BB5ED53A4C98E4F9A35839EDE1853965F7@nkgeml514-mbx.china.huawei.com> <1756a532-ed56-f2f8-0463-bd659923acd1@redhat.com> <87B246BB5ED53A4C98E4F9A35839EDE185397B0E@nkgeml514-mbx.china.huawei.com> <87B246BB5ED53A4C98E4F9A35839EDE185399B59@nkgeml514-mbx.china.huawei.com> From: Waiman Long Organization: Red Hat Message-ID: <6de809d1-a255-a4c5-095a-00751090103b@redhat.com> Date: Fri, 18 Aug 2017 10:10:17 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <87B246BB5ED53A4C98E4F9A35839EDE185399B59@nkgeml514-mbx.china.huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 18 Aug 2017 14:10:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/18/2017 05:59 AM, Wangkai (Kevin,C) wrote: > >>> In my patch the DCACHE_FILE_REMOVED flag was to distinguish the >>> removed file and The closed file, I found there was no difference of a >>> dentry between the removed file and the closed File, they all on the lru list. >> There is a difference between removed file and closed file. The type field of >> d_flags will be empty for a removed file which indicate a negative dentry. >> Anything else is a positive dentry. Look at the inline function d_is_negative() >> [d_is_miss()] and you will see how it is done. > After the file was removed, the dentry flag was not MISS, the flag was: > DCACHE_REFERENCED | DCACHE_RCUACCESS | DCACHE_LRU_LIST | DCACHE_REGULAR_TYPE > So, the dentry never be freed, until the kernel reclaim the slab memory. The dentry_unlink_inode() function will clear DCACHE_REGULAR_TYPE. Cheers, Longman