Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2002 13:47:10 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        "M. Warner Losh" <imp@village.org>
Cc:        mike@FreeBSD.ORG, cjclark@alum.mit.edu, freebsd-arch@FreeBSD.ORG
Subject:   Re: Setting sysctl(8)'s in rc.conf
Message-ID:  <200202052147.g15LlAM30476@apollo.backplane.com>
References:  <20020204145021.B3722@gohan.cjclark.org> <20020205015412.H6496@espresso.q9media.com> <20020205.085412.88169750.imp@village.org>

next in thread | previous in thread | raw e-mail | index | archive | help

: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 
					<dillon@backplane.com>

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




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