[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-fs
Subject:    Re: dirhash and dynamic memory allocation
From:       Ivan Voras <ivoras () freebsd ! org>
Date:       2011-10-22 13:28:56
Message-ID: CAF-QHFUp6sX-JG+6N8WGUN2_taS+K4y1-F8Vs5CS6kOi=rx5Uw () mail ! gmail ! com
[Download RAW message or body]

On 22 October 2011 04:16, Doug Barton <dougb@freebsd.org> wrote:
> On 10/21/2011 08:38, Miroslav Lachman wrote:

>> will be allways between these two limits?
>
> Isn't that what vfs.ufs.dirhash_minsize is for? I think given that there
> is a lot more memory in modern systems setting that higher by default is
> probably a good idea. Or maybe I'm misunderstanding what that knob does?

Directories are AFAIK cached "all or nothing" so if there are some
large directories in the dirhash and they are evicted, it's possible
to end up with "0" dirhash used without being able to fit a directory
in the dirhash_minsize for any reasonable amount of time.
>>> 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 didn't tried 9 yet. Does it mean dirhash_maxmem is initially set to
>> approximately 1% of physical RAM and then it can be set higher by sysctl
>> as in older versions?
>
> I'm not sure that's what's happening, I have 6G of ram in this box and I
> have this by default:
>
> vfs.ufs.dirhash_maxmem: 9977856

It's actually not a direct percentage of memory but it's tied to
hibufspace which is itself auto-tuned here:
http://fxr.watson.org/fxr/source/kern/vfs_bio.c?v=FREEBSD8#L606 . So
yes, it's nonlinear (and it probably doesn't matter).
_______________________________________________
freebsd-fs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic