From 4a766b64094ede0489d7ba2db9d0ab505fa91afd Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 2 Aug 2008 14:34:29 +0000 Subject: [PATCH] MFC 1.117 - fix desiredvnodes calculation for machines with >2G ram. Requested-by: Francois Tigeot --- sys/kern/vfs_subr.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 89db975169..f79136f7b1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -37,7 +37,7 @@ * * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 * $FreeBSD: src/sys/kern/vfs_subr.c,v 1.249.2.30 2003/04/04 20:35:57 tegge Exp $ - * $DragonFly: src/sys/kern/vfs_subr.c,v 1.116 2008/07/12 02:44:59 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_subr.c,v 1.116.2.1 2008/08/02 14:34:29 dillon Exp $ */ /* @@ -173,16 +173,14 @@ void vfs_subr_init(void) { /* - * Desired vnodes is a result of the physical page count - * and the size of kernel's heap. It scales in proportion - * to the amount of available physical memory. This can - * cause trouble on 64-bit and large memory platforms. + * Desiredvnodes is kern.maxvnodes. We want to scale it + * according to available system memory but we may also have + * to limit it based on available KVM, which is capped on 32 bit + * systems. */ - /* desiredvnodes = maxproc + vmstats.v_page_count / 4; */ - desiredvnodes = - min(maxproc + vmstats.v_page_count / 4, - 2 * KvaSize / - (5 * (sizeof(struct vm_object) + sizeof(struct vnode)))); + desiredvnodes = min(maxproc + vmstats.v_page_count / 4, + KvaSize / (20 * + (sizeof(struct vm_object) + sizeof(struct vnode)))); lwkt_token_init(&spechash_token); } -- 2.11.4.GIT