dirhash and dynamic memory allocation

Miroslav Lachman 000.fbsd at quip.cz
Fri Oct 14 12:33:21 UTC 2011



Ivan Voras wrote:
> On 14/10/2011 11:20, Miroslav Lachman wrote:
>> Hi all,
>>
>> I tried some tuning of dirhash on our servers and after googlig a bit, I
>> found an old GSoC project wiki page about Dynamic Memory Allocation for
>> Dirhash: http://wiki.freebsd.org/DirhashDynamicMemory
>> Is there any reason not to use it / not commit it to HEAD?
>
> AFAIK it's sort-of already present. In 8-stable and recent kernels you
> can give huge amounts of memory to dirhash via vfs.ufs.dirhash_maxmem
> (but except in really large edge cases I don't think you *need* more
> than 32 MB), and the kernel will scale-down or free the memory if not
> needed.

Is this change documented somewhere? Maybe it could be noticed on 
DirhashDynamicMemory wiki page. Otherwise it seems as abandoned GSoC 
project.

> In effect, vfs.ufs.dirhash_maxmem is the upper limit - the kernel will
> use less and will free the allocated memory in low memory situations
> (which I've tried and it works).
>
>> And second question - is there any negative impact with higher
>> vfs.ufs.dirhash_maxmem? It stil defaults to 2MB (on FreeBSD 8.2) after
>
> Not that I know of.
>
>> 10 years, but I think we all are using bigger FS in these days with lot
>> of files and directories and 2MB is not enough.
>
> AFAIK I've changed it to autotune so it's configured to approximately 4
> MB on a 4 GB machine (and scales up) in 9.

I don't have 9 installed to test it. Only 8-STABLE. Hope I will test it 
soon.

Thank you for your informations!

Miroslav Lachman


More information about the freebsd-fs mailing list