From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60902 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753748AbeGCA7c (ORCPT ); Mon, 2 Jul 2018 20:59:32 -0400 Subject: Re: [PATCH v5 2/6] fs/dcache: Make negative dentry tracking configurable To: Andrew Morton Cc: Alexander Viro , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linus Torvalds , Jan Kara , "Paul E. McKenney" , Ingo Molnar , Miklos Szeredi , Matthew Wilcox , Larry Woodman , James Bottomley , "Wangkai (Kevin C)" References: <1530510723-24814-1-git-send-email-longman@redhat.com> <1530510723-24814-3-git-send-email-longman@redhat.com> <20180702141206.8d08b4769a9c8a4300ce06de@linux-foundation.org> From: Waiman Long Message-ID: Date: Tue, 3 Jul 2018 08:59:25 +0800 MIME-Version: 1.0 In-Reply-To: <20180702141206.8d08b4769a9c8a4300ce06de@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07/03/2018 05:12 AM, Andrew Morton wrote: > On Mon, 2 Jul 2018 13:51:59 +0800 Waiman Long wrote: > >> The negative dentry tracking is made a configurable option so that >> users who don't care about negative dentry tracking will have the >> option to disable it. The new config option DCACHE_TRACK_NEG_ENTRY >> is disabled by default. >> >> If this option is enabled, a new kernel parameter "neg_dentry_pc=<%>" >> allows users to set the soft limit on how many negative dentries are >> allowed as a percentage of the total system memory. The default is 2% >> and this new parameter accept a range of 0-10% where 0% means there >> is no limit. >> >> When the soft limit is reached, a warning message will be printed to >> the console to alert the system administrator. > It would be much more convenient if this was tunable at runtime via yet > another /proc knob. Is there any particular reason why we can't do this? > The percpu accounting of negative dentries cannot be dynamically turn on and off or the count won't be accurate. Fortunately that part shouldn't introduce any noticeable overhead. Everything else can be dynamically turn on or off, if desired. I will look into making this patchset more dynamic in the next version. Cheers, Longman