Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Nov 2001 22:47:30 +0700
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        stable@freebsd.org, hackers@freebsd.org
Subject:   Re: kern.vm.kmem.size
Message-ID:  <20011113224730.A864@grosbein.pp.ru>
In-Reply-To: <20011113151329.A44837@walton.maths.tcd.ie>; from dwmalone@maths.tcd.ie on Tue, Nov 13, 2001 at 03:13:29PM %2B0000
References:  <20011111230817.A2325@grosbein.pp.ru> <20011113151329.A44837@walton.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 13, 2001 at 03:13:29PM +0000, David Malone wrote:

> > I'm trying to test and tune speed of freebsd's filesystem in many aspects.
> > I run recent FreeBSD 4.4-STABLE with new dirprefs code, read tuning(7),
> > newfs'd my FS, turned softupdates on, have UFS_DIRHASH kernel option.
> > Also, I've read DIRHASH kernel code source. It seems that efficiency of
> > DIRHASH greatly depends of kernel memory size (and some experiments
> > approve this).
> 
> You should be able to control how much memory is used by dirhash
> with the vfs.ufs.dirhash_maxmem sysctl. By default it uses up to
> 2MB and it should be possible to raise it significantly, providing
> you have enough physical memory. (By default there is about 1GB of
> kernel address space, so you are unlikely to be running into this
> limit - I don't think changing kern.vm.kmem.size will help you).

Are you shure? From LINT:

# Tune the kernel malloc area parameters.  VM_KMEM_SIZE represents the
# minimum, in bytes, and is typically (12*1024*1024) (12MB).
# VM_KMEM_SIZE_MAX represents the maximum, typically 200 megabytes.
# VM_KMEM_SIZE_SCALE can be set to adjust the auto-tuning factor, which
# typically defaults to 4 (kernel malloc area size is physical memory
# divided by the scale factor).
#
options         VM_KMEM_SIZE="(10*1024*1024)"
options         VM_KMEM_SIZE_MAX="(100*1024*1024)"
options         VM_KMEM_SIZE_SCALE="4"

It seems DIRHASH is limited with free space in the kernel malloc area.
It even cannot utilize default 2M of vfs.ufs.dirhash_maxmem when I do not
increase kern.vm.kmem.size. I think it's because of kernel malloc area
exhaustion. However, when I increase kern.vm.kmem.size upto 64M and
vfs.ufs.dirhash_maxmem upto 8M, it starts using more than 2M of
dirhash memory and speed of my tests greatly improves.

So, how can I estimate needed value of kern.vm.kmem.size?

Eugene Grosbein

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011113224730.A864>