From owner-freebsd-arch Tue Feb 5 13:47:19 2002 Delivered-To: freebsd-arch@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 919D937B427; Tue, 5 Feb 2002 13:47:12 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id g15LlAM30476; Tue, 5 Feb 2002 13:47:10 -0800 (PST) (envelope-from dillon) Date: Tue, 5 Feb 2002 13:47:10 -0800 (PST) From: Matthew Dillon Message-Id: <200202052147.g15LlAM30476@apollo.backplane.com> To: "M. Warner Losh" Cc: mike@FreeBSD.ORG, cjclark@alum.mit.edu, freebsd-arch@FreeBSD.ORG Subject: Re: Setting sysctl(8)'s in rc.conf References: <20020204145021.B3722@gohan.cjclark.org> <20020205015412.H6496@espresso.q9media.com> <20020205.085412.88169750.imp@village.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :We also need to fix setting sysctl variables late in the boot process, :maybe after modules have been loaded early in the process. I've :punted on doing this right becuase of the bikeshed around the name for :/etc/sysctl.conf's companion that would be done late in the process... : :Warner It occurs to me that somebody might try to set the boot-time tunable kern.maxusers to 0, a case I do not currently handle. Right now I only handle the kernel config's maxusers being set to 0. Perhaps something like the below is better. Comments? -Matt Matthew Dillon Index: kern/subr_param.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_param.c,v retrieving revision 1.51 diff -u -r1.51 subr_param.c --- kern/subr_param.c 25 Jan 2002 01:54:16 -0000 1.51 +++ kern/subr_param.c 5 Feb 2002 21:45:51 -0000 @@ -133,14 +133,15 @@ { /* Base parameters */ - if ((maxusers = MAXUSERS) == 0) { + maxusers = MAXUSERS; + TUNABLE_INT_FETCH("kern.maxusers", &maxusers); + if (maxusers == 0) { maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; if (maxusers > 384) maxusers = 384; } - TUNABLE_INT_FETCH("kern.maxusers", &maxusers); /* * The following can be overridden after boot via sysctl. Note: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message