dirhash and dynamic memory allocation

Ivan Voras ivoras at freebsd.org
Fri Oct 14 10:35:32 UTC 2011


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.

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20111014/b684ec2f/signature.pgp


More information about the freebsd-fs mailing list