From: Waiman Long <longman@redhat.com>
To: "Wangkai (Kevin,C)" <wangkai86@huawei.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jonathan Corbet <corbet@lwn.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Miklos Szeredi <mszeredi@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Larry Woodman <lwoodman@redhat.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH v3 0/5] fs/dcache: Limit # of negative dentries
Date: Mon, 21 Aug 2017 09:34:38 -0400 [thread overview]
Message-ID: <0cd48ec2-fd71-7c3c-fcf4-82df9cacd1f6@redhat.com> (raw)
In-Reply-To: <87B246BB5ED53A4C98E4F9A35839EDE185399FA8@nkgeml514-mbx.china.huawei.com>
On 08/20/2017 11:23 PM, Wangkai (Kevin,C) wrote:
>
> Yes, I have add some trace info for the dentry state changed, with dentry flag and reference count:
>
> File create:
> [ 42.636675] dentry [xxxx_1234] 0xffff880230be8180 flag 0x0 ref 1 ev dentry alloc
> File close:
> [ 42.637421] dentry [xxxx_1234] 0xffff880230be8180 flag 0x4800c0 ref 0 ev dput called
>
> Unlink lookup:
> [ 244.658086] dentry [xxxx_1234] 0xffff880230be8180 flag 0x4800c0 ref 1 ev d_lookup
> Unlink d_delete:
> [ 244.658254] dentry [xxxx_1234] 0xffff880230be8180 flag 0x800c0 ref 1 ev d_lockref ref 1
> Unlink dput:
> [ 244.658438] dentry [xxxx_1234] 0xffff880230be8180 flag 0x800c0 ref 0 ev dput called
>
> The end, dentry's flag stay at 0x800c0, but this dentry was not freed, keeped by the dcache as unused,
> After tens of thousands of the dentries slow down the dentry lookup performance, kernel memory usage
> Keep high.
>
> Regards,
> Kevin
That is expected. The kernel does not get rid of negative dentries until
the shrinker is called because of memory pressure. Negative dentries do
help to improve file lookup performance. However, too much of negative
dentries suppress the amount of free memory available for other use.
That is why I send out my patch to limit the number of negative dentries
outstanding.
Cheers,
Longman
next prev parent reply other threads:[~2017-08-21 13:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 18:34 [PATCH v3 0/5] fs/dcache: Limit # of negative dentries Waiman Long
2017-07-28 18:34 ` [PATCH v3 1/5] fs/dcache: Limit numbers " Waiman Long
2017-07-28 18:34 ` [PATCH v3 2/5] fs/dcache: Report negative dentry number in dentry-state Waiman Long
2017-07-28 18:34 ` [PATCH v3 3/5] fs/dcache: Enable automatic pruning of negative dentries Waiman Long
2017-07-28 18:34 ` [PATCH v3 4/5] fs/dcache: Protect negative dentry pruning from racing with umount Waiman Long
2017-07-28 18:34 ` [PATCH v3 5/5] fs/dcache: Track count of negative dentries forcibly killed Waiman Long
2017-08-15 17:15 ` [PATCH v3 0/5] fs/dcache: Limit # of negative dentries Waiman Long
2017-08-16 10:33 ` Wangkai (Kevin,C)
2017-08-16 13:29 ` Waiman Long
2017-08-17 4:00 ` Wangkai (Kevin,C)
2017-08-17 13:04 ` Waiman Long
2017-08-18 9:59 ` Wangkai (Kevin,C)
2017-08-18 14:10 ` Waiman Long
2017-08-21 3:23 ` Wangkai (Kevin,C)
2017-08-21 13:34 ` Waiman Long [this message]
2017-08-22 2:59 ` Wangkai (Kevin,C)
2017-08-28 17:58 ` Waiman Long
2017-08-28 18:59 ` Waiman Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0cd48ec2-fd71-7c3c-fcf4-82df9cacd1f6@redhat.com \
--to=longman@redhat.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lwoodman@redhat.com \
--cc=mingo@kernel.org \
--cc=mszeredi@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=wangkai86@huawei.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).