Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2001 18:59:38 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        current@freebsd.org
Cc:        terry@lambert.org
Subject:   PATCH to make maxfiles, maxfiles per proc boot-time tunable
Message-ID:  <200104241859.LAA02506@usr08.primenet.com>

next in thread | raw e-mail | index | archive | help
It seems to me that these things are not boot-time tunable, and
should be (really, they should be runtime tunable, but there
are some nasty pageable region allocations for networking that
appear to require contiguous regions for no good reason which I
can discern).  That means that the best we can do right now is
boot-time, so here it is:


--------------------------------------------------------------------------
Index: conf/param.c
===================================================================
RCS file: /home/cvs/local_repo/FreeBSD/sys.releng4/conf/param.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 param.c
*** conf/param.c	2001/03/21 00:50:42	1.1.1.1
--- conf/param.c	2001/04/19 20:57:59
***************
*** 44,49 ****
--- 44,51 ----
  #include "opt_param.h"
  
  #include <sys/param.h>
+ #include <sys/systm.h>		/* getenv_int */
+ #include <sys/kernel.h>		/* TUNABLE_INT_DECL */
  
  /*
   * System parameter formulae.
***************
*** 67,74 ****
  #endif
  int	maxproc = NPROC;			/* maximum # of processes */
  int	maxprocperuid = NPROC-1;		/* maximum # of processes per user */
! int	maxfiles = MAXFILES;			/* system wide open files limit */
! int	maxfilesperproc = MAXFILES;		/* per-process open files limit */
  int	ncallout = 16 + NPROC + MAXFILES;	/* maximum # of timer events */
  int	mbuf_wait = 32;				/* mbuf sleep time in ticks */
  
--- 69,78 ----
  #endif
  int	maxproc = NPROC;			/* maximum # of processes */
  int	maxprocperuid = NPROC-1;		/* maximum # of processes per user */
! int	maxfiles = 0;			/* system wide open files limit */
! TUNABLE_INT_DECL("kern.maxfiles", MAXFILES, maxfiles);
! int	maxfilesperproc = 0;		/* per-process open files limit */
! TUNABLE_INT_DECL("kern.maxfilesperproc", MAXFILES, maxfilesperproc);
  int	ncallout = 16 + NPROC + MAXFILES;	/* maximum # of timer events */
  int	mbuf_wait = 32;				/* mbuf sleep time in ticks */
  
--------------------------------------------------------------------------


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

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




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