From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Ian Kent <raven@themaw.net>, Christian Brauner <brauner@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Miklos Szeredi <miklos@szeredi.hu>,
Eric Sandeen <sandeen@sandeen.net>,
Frank Sorenson <fsorenso@redhat.com>,
Jay Shin <jaeshin@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Yafang Shao <laoar.shao@gmail.com>, Jan Kara <jack@suse.cz>,
Waiman Long <longman@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Wangkai <wangkai86@huawei.com>,
Colin Walters <walters@verbum.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] vfs: limit directory child dentry retention
Date: Wed, 1 Apr 2026 09:47:02 +0800 [thread overview]
Message-ID: <b04c1c86-100e-467b-b104-7312c4dd0251@linux.alibaba.com> (raw)
In-Reply-To: <d54d4791-dab3-4141-9665-091fc8918235@themaw.net>
On 2026/4/1 09:38, Ian Kent wrote:
> On 31/3/26 17:54, Gao Xiang wrote:
>> Hi,
>>
>> On 2026/3/31 17:39, Christian Brauner wrote:
>>> On Tue, Mar 31, 2026 at 09:29:09AM +0800, Ian Kent wrote:
>>>> If there's a very large number of children present in a directory dentry
>>>> then the benifit from retaining stale child dentries for re-use can
>>>> become ineffective. Even hashed lookup can become ineffective as hash
>>>> chains grow, time taken to umount a file system can increase a lot, as
>>>> well as child dentry traversals resulting in lock held too long log
>>>> messages.
>>>
>>> Fwiw, there's also e6957c99dca5 ("vfs: Add a sysctl for automated deletion of dentry")
>>>
>>> This patch introduces the concept conditionally, where the associated
>>> dentry is deleted only when the user explicitly opts for it during file
>>> removal. A new sysctl fs.automated_deletion_of_dentry is added for this
>>> purpose. Its default value is set to 0.
>>>
>>> I have no massive objections to your approach. It feels a bit hacky tbh
>>> as it seems to degrade performance for new workloads in favor old
>>> workloads. The LRU should sort this out though.
>>
>> JFYI, another issue we once observed on user workloads is that
>>
>> `d_lockref.count` can exceed `int` on very very large
>> directories in reality (also combined with cached
>> negative dentries).
>
> Ouch!
>
> So more than 2 Billion?
We received some report.
>
> I suspect in that case you have much bigger problems than 7 or 8
>
> million dentries on the LRU list and linked into the directory.
That shrinker seemed not to be triggered at all
since the memory was abundant on those bare
metals; I don't see how it cannot happen with
enough memory and trigger negative lookups on
a directory for example.
However, it was a report quite few years ago, but
I remembered it was a real user report
(`d_lockref.count` overflowed).
Thanks,
Gao Xiang
>
>
>>
>> It can be a real overflow, this commit can help but it
>> doesn't strictly resolve this, anyway.
>>
>> Thanks,
>> Gao Xiang
next prev parent reply other threads:[~2026-04-01 1:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 1:29 [RFC PATCH] Limit " Ian Kent
2026-03-31 1:29 ` [RFC PATCH] vfs: limit " Ian Kent
2026-03-31 9:39 ` Christian Brauner
2026-03-31 9:54 ` Gao Xiang
2026-03-31 14:59 ` Mateusz Guzik
2026-03-31 15:11 ` Gao Xiang
2026-04-01 1:38 ` Ian Kent
2026-04-01 1:47 ` Gao Xiang [this message]
2026-04-01 2:21 ` Ian Kent
2026-04-01 2:40 ` Linus Torvalds
2026-04-01 2:10 ` Ian Kent
2026-04-07 10:35 ` Christian Brauner
2026-04-07 12:41 ` Ian Kent
2026-04-08 10:17 ` Jan Kara
2026-04-09 0:59 ` Ian Kent
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=b04c1c86-100e-467b-b104-7312c4dd0251@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=brauner@kernel.org \
--cc=fsorenso@redhat.com \
--cc=jack@suse.cz \
--cc=jaeshin@redhat.com \
--cc=laoar.shao@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=miklos@szeredi.hu \
--cc=raven@themaw.net \
--cc=sandeen@sandeen.net \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=walters@verbum.org \
--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
all inboxes | Powered by JetHome®