From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:34542 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbdJKU4w (ORCPT ); Wed, 11 Oct 2017 16:56:52 -0400 Date: Thu, 12 Oct 2017 07:56:49 +1100 From: Dave Chinner To: Waiman Long Cc: Andrew Morton , 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)" Subject: Re: [PATCH v4 0/6] fs/dcache: Limit # of negative dentries Message-ID: <20171011205649.GL15067@dastard> References: <1505758834-1201-1-git-send-email-longman@redhat.com> <20171010155439.d8f4bc552a81290fd5bec8cd@linux-foundation.org> <41d8db7e-4538-aaaf-6d65-574b5c0ffd7a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41d8db7e-4538-aaaf-6d65-574b5c0ffd7a@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Oct 11, 2017 at 04:47:05PM -0400, Waiman Long wrote: > On 10/10/2017 06:54 PM, Andrew Morton wrote: > > On Mon, 18 Sep 2017 14:20:28 -0400 Waiman Long wrote: > > > >> A rogue application can potentially create a large number of negative > >> dentries in the system consuming most of the memory available even if > >> memory controller is enabled to limit memory usage. This can impact > >> performance of other applications running on the system. > > It does seem that under these circumstances it is pretty silly of us to > > reclaim useful things in order to instantiate zillions of -ve dentries. > > I am talking about a misbehaving program due to bug or an intentional > rogue program. > > > > > Dentries are subject to kmemcg handling. Does this not help avoid > > "impacting performance of other applications"? > > AFAIK, the dentry kmem_cache isn't memcg aware. The dentry cache is most definitely is memcg aware. It (and teh inode cache) were the primary targets for the memcg slab reclaim infrastructure. #if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) # define SLAB_ACCOUNT 0x04000000UL /* Account to memcg */ #else # define SLAB_ACCOUNT 0x00000000UL #endif dcache_init(): dentry_cache = KMEM_CACHE(dentry, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD|SLAB_ACCOUNT); Cheers, Dave. -- Dave Chinner david@fromorbit.com