[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4b36ebf6-e886-03c5-5a78-75962bd005fe@redhat.com>
Date: Wed, 11 Oct 2017 17:08:42 -0400
From: Waiman Long <longman@...hat.com>
To: Dave Chinner <david@...morbit.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jan Kara <jack@...e.cz>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Ingo Molnar <mingo@...nel.org>,
Miklos Szeredi <mszeredi@...hat.com>,
Matthew Wilcox <willy@...radead.org>,
Larry Woodman <lwoodman@...hat.com>,
James Bottomley <James.Bottomley@...senPartnership.com>,
"Wangkai (Kevin C)" <wangkai86@...wei.com>
Subject: Re: [PATCH v4 0/6] fs/dcache: Limit # of negative dentries
On 10/11/2017 04:56 PM, Dave Chinner wrote:
> 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 <longman@...hat.com> 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);
>
Oh, my bad! You are right.
However, it is still a problem for applications that are not being under
any memcg.
Cheers,
Longman
Powered by blists - more mailing lists