[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <741172f7-a0d2-1428-fb25-789e38978d4e@redhat.com>
Date: Fri, 8 May 2020 15:05:18 -0400
From: Waiman Long <longman@...hat.com>
To: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, Alexander Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH RFC 1/8] dcache: show count of hash buckets in sysctl
fs.dentry-state
On 5/8/20 12:16 PM, Konstantin Khlebnikov wrote:
> On 08/05/2020 17.49, Waiman Long wrote:
>> On 5/8/20 8:23 AM, Konstantin Khlebnikov wrote:
>>> Count of buckets is required for estimating average length of hash
>>> chains.
>>> Size of hash table depends on memory size and printed once at boot.
>>>
>>> Let's expose nr_buckets as sixth number in sysctl fs.dentry-state
>>
>> The hash bucket count is a constant determined at boot time. Is there
>> a need to use up one dentry_stat entry for that? Besides one can get
>> it by looking up the kernel dmesg log like:
>>
>> [ 0.055212] Dentry cache hash table entries: 8388608 (order: 14,
>> 67108864 bytes)
>
> Grepping logs since boot time is a worst API ever.
>
> dentry-state shows count of dentries in various states.
> It's very convenient to show count of buckets next to it,
> because this number defines overall scale.
I am not against using the last free entry for that. My only concern is
when we want to expose another internal dcache data point via
dentry-state, we will have to add one more number to the array which can
cause all sort of compatibility problem. So do we want to use the last
free slot for a constant that can be retrieved from somewhere else?
Cheers,
Longman
Powered by blists - more mailing lists