2010-07-26 15:21:43

by Casey Bodley

[permalink] [raw]
Subject: dentry cache memory usage

I'm a developer at CITI working on the windows pnfs client. We've
been looking into some optimizations for our name and attribute
caches, mainly involving the use of pools to avoid allocating memory
for each new entry.

We're looking for a sensible initial/maximum pool size. Once the
maximum pool size is reached, we'll start scavenging the least
recently used entries. Does the linux client impose any limits on the
size of the dentry cache?

I'm also curious what time limits you're using before expiring cached
attributes and lookups.

I suppose I'm just asking for magic numbers here, in the hope that
smart people have tested and benchmarked this stuff in the linux
client.

Thanks,
Casey


2010-07-26 15:34:01

by Trond Myklebust

[permalink] [raw]
Subject: Re: dentry cache memory usage

On Mon, 2010-07-26 at 11:21 -0400, Casey Bodley wrote:
> I'm a developer at CITI working on the windows pnfs client. We've
> been looking into some optimizations for our name and attribute
> caches, mainly involving the use of pools to avoid allocating memory
> for each new entry.
>
> We're looking for a sensible initial/maximum pool size. Once the
> maximum pool size is reached, we'll start scavenging the least
> recently used entries. Does the linux client impose any limits on the
> size of the dentry cache?
>
> I'm also curious what time limits you're using before expiring cached
> attributes and lookups.
>
> I suppose I'm just asking for magic numbers here, in the hope that
> smart people have tested and benchmarked this stuff in the linux
> client.

Linux doesn't really allow you to set a maximum dcache size. Instead,
the system allows you to allocate as many dentries as you like. When the
system runs low on memory, the VM will trigger an LRU based reclaim of
older dentries.

The page cache is managed on a similar basis.

Cheers
Trond