Home | History | Annotate | Download | only in conf
History log of /src/sys/conf/param.c
RevisionDateAuthorComments
 1.70  23-Jul-2022  mrg make MAXLWP a real option that triggers rebuilds properly.
 1.69  12-Nov-2020  simonb Set a better default for MAXFILES on larger RAM machines if not
otherwise specified the kernel config file. Arbitary numbers are
20,000 files for 16GB RAM or more and 10,000 files for 1GB RAM or
more.

TODO: Adjust this and other values totally dynamically.
 1.68  09-Apr-2019  pgoyette branches: 1.68.4; 1.68.12;
defparam all of the config variables associated with SYSV IPC stuff.
The variables were removed from sys/conf/param.c and moved into the
SYSV IPC code, but config options were never propagated via any opt_*
file.

This should fix an issue reported on netbsd-users list from Dima Veselov.

Note that this does not address other parameters included in that report,
including CHILD_MAX and NOFILE; this commit only affects items related to
the SYSV IPC code. Also note that this does not affect non-built-in
sysv_ipc modules, for which you need to update the Makefile to use any
non-standard config values - just like any other non-built-in modules
which have config params.

XXX Pull-up to -8 and -8-0

XXX Note that there are a couple of panic() calls in msginit() which
XXX really should be changed to simple printf() and then result in
XXX msginit failure. Unfortunately msginit() currently doesn't return
XXX a value so we cannot indicate failure to the caller. I will fix
XXX this is a future commit.
 1.67  09-Nov-2015  pgoyette branches: 1.67.10; 1.67.18;
Whether or not the semaphore code is loaded as a module or built-in, its
sysctl data belongs with the module code. Move it from kern/init_sysctl.c
to kern/uipc_sem.c

While here, add a new sysctl variable kern.posix.semcnt (current count of
semaphores) to complement the existing kern.posix.semmax (maximum number
of semaphores).
 1.66  24-Aug-2015  pooka to garnish, dust with _KERNEL_OPT
 1.65  13-May-2015  pgoyette Create a new sysv_ipc module to contain the SYSVSHM, SYSVSEM, and
SYSVMSG options. Move associated variables out of param.c and into
the module's source file.
 1.64  09-Jun-2012  christos branches: 1.64.2; 1.64.16;
Add a new resource to limit the number of lwps per user, RLIMIT_NTHR. There
is a global sysctl kern.maxlwp to control this, which is by default 2048.
The first lwp of each process or kernel threads are not counted against the
limit. To show the current resource usage per user, I added a new sysctl
that dumps the uidinfo structure fields.
 1.63  08-Feb-2010  joerg branches: 1.63.10;
Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
 1.62  03-May-2009  elad branches: 1.62.2;
Move dovfsusermount to secmodel_bsd44, where it really belongs.

The secmodel code now creates the same knob in two places: both under the
secmodel itself, as well as the widely known location.

Mailing list references:

http://mail-index.netbsd.org/source-changes/2009/05/02/msg220641.html
http://mail-index.netbsd.org/tech-kern/2009/05/03/msg005015.html
 1.61  02-May-2009  pooka Move dovfsusermount from vfs_syscalls.c to param.c: secmodel bsd44
depends on it and we can't isolate it in vfs.
(no, it doesn't really belong in param.c, but I couldn't figure out
a better place for it)
 1.60  06-Mar-2009  joerg Remove SHMMAXPGS from all kernel configs. Dynamically compute the
initial limit as 1/4 of the physical memory. Ensure the limit is at
least 1024 pages, the old default on most platforms.
 1.59  12-Nov-2008  ad branches: 1.59.4;
Allow the POSIX semaphore code to be loaded as a module.
 1.58  12-Jul-2008  gmcgarry branches: 1.58.2;
Disable INCLUDE_CONFIG_FILE if compiling with PCC, since PCC cannot
handle 80KB string literals. Documented as hack.
 1.57  02-Jul-2008  ad branches: 1.57.2;
Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@.
 1.56  27-Mar-2008  ad branches: 1.56.4; 1.56.6; 1.56.8;
ALIGNBYTES + 1, not ALIGNBYTES in previous.
 1.55  27-Mar-2008  ad Introduce COHERENCY_UNIT/coherency_unit as proposed on tech-kern.
 1.54  15-Mar-2008  ad Add a 'maxcpus' global.
 1.53  26-Dec-2007  ad branches: 1.53.2; 1.53.6;
Merge more changes from vmlocking2, mainly:

- Locking improvements.
- Use pool_cache for more items.
 1.52  17-May-2007  yamt branches: 1.52.8; 1.52.14; 1.52.16; 1.52.20;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.51  20-Jan-2007  ad branches: 1.51.2; 1.51.6; 1.51.8;
Remove long unused 'ncallout'.
 1.50  21-Dec-2005  yamt branches: 1.50.20;
defparam NMBCLUSTERS.
 1.49  11-Dec-2005  christos merge ktrace-lwp.
 1.48  27-Sep-2004  christos branches: 1.48.12;
Disable autonicetime. As discusses in tech-kern.
 1.47  01-Jul-2004  yamt avoid divide-by-zero in adjtime1() in the case of HZ > 6000.
 1.46  01-Jul-2004  yamt defparam HZ.
 1.45  31-Dec-2003  martin s/NBPG/PAGE_SIZE/ in a comment.
From Jeff Ito in PR kern/23935.
 1.44  30-Dec-2003  pk Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms. Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
 1.43  30-Oct-2003  drochner there is no SHMMMNI
 1.42  21-Oct-2003  thorpej Cache the "adjusted" value of sb_max when sb_max is changed, in order
to avoid doing quad math in sbreserve().

Change suggested by Simon Burge, and code inspired by a similar change
in FreeBSD.
 1.41  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.40  17-Dec-2001  atatat branches: 1.40.16;
Provide hooks to include the config file(s) in the kernel binary.
 1.39  08-Nov-2001  lukem add RCSID
 1.38  20-Aug-2001  mrg branches: 1.38.4;
allow SHMMAX, SHMMIN, SHMMNI and SHMSEG to be specified in the kernel config file.
 1.37  11-Nov-2000  mycroft branches: 1.37.2; 1.37.4;
Make SHMSEG much larger to accomodate GNOME and imlib.
It's limited by SHMMAXPGS anyway.
 1.36  24-Sep-2000  jdolecek defopt SHMMAXPGS, SEMMNI, SEMMNS, SEMUME and SEMMNU
 1.35  15-Apr-2000  simonb branches: 1.35.4;
Remove shmsegs declaration from conf/param.c - it doesn't belong here.
Instead, put it in kern/sysv_shm.c.
 1.34  28-Mar-2000  simonb Declare the SysV IPC *info structures and shmsegs pointer as extern.
Add declaration for shmsegs to param.c after shminfo structure.
 1.33  23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.32  04-Dec-1999  ragge CL* discarding.
 1.31  20-May-1999  lukem branches: 1.31.2; 1.31.8;
remove nbuf, nswbuf. cleanup def of AUTONICE(TIME|VAL)
 1.30  20-May-1999  cgd g.c. now-unneeded variable declarations (cfree, swbuf, utsname
 1.29  26-Apr-1999  thorpej Add `mblowat' and `mcllowat' low water mark variables for mbufs and mbuf
clusters.
 1.28  25-Apr-1999  simonb Const msize & mclbytes.
 1.27  25-Apr-1999  simonb g/c REAL_CLISTS.
 1.26  22-Apr-1999  simonb Move inclusion of "opt_sb_max.h" from sys/socketvar.h to
conf/param.c, and move the initialisation of the sb_max
variable from kern/uipc_socket2.c to conf/param.c. Now
everthing that includes sys/socketvar.h doesn't get
recompiled when SB_MAX's value changes.
 1.25  23-Oct-1998  jonathan branches: 1.25.8;
Compute compile-time value of old-VM parameter MAX_KMAPENT from NPROC
(2x NPROC plus slop) unless expclitly set. Use current constant value
(100) as a lower bound, as suggested by Chuck Cranor.

Move NPROC and other parameter definitions from param.c to param.h so
they are visible to vm/vm_map.h.

Systems with hand-tuned NPROC should now support that many processes.
 1.24  19-Oct-1998  tron Defopt SYSVMSG, SYSVSEM and SYSVSHM.
 1.23  05-Feb-1998  mrg initial import of the new virtual memory system, UVM, into -current.

UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code. i provided some help
getting swap and paging working, and other bug fixes/ideas. chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly. :-)
 1.22  20-Sep-1997  enami branches: 1.22.2;
Convert RTC_OFFSET, DEVPAGER, SWAPPAGER and VNODEPAGER to be declared
by defopt.
 1.21  28-Feb-1997  jonathan branches: 1.21.4;
Add compiled-in MCLBYTES and MSIZE to conf/param.c, as 'mclbytes" and "msize".

Add code to netstat to use libkvm to for kernel variables "mclbytes"
and "msize', and if found, use those for netstat -m rather than
compiled-in defaults.
 1.20  30-Jan-1997  tls branches: 1.20.4;
fix a large number of braindead unconditional #defines
 1.19  15-Jan-1997  perry Eliminate obsolete TIMEZONE and DST options.
Eliminate obsolete global kernel variable "struct timezone tz"
Add RTC_OFFSET option
Add global kernel variable rtc_offset, which is initialized by
RTC_OFFSET at kernel compile time.
on i386, x68k, mac68k, pc532 and arm32, RTC_OFFSET indicates how many
minutes west (east) of GMT the hardware RTC runs. Defaults to 0.
Places where tz variable was used to indicate this in the past have
been replaced with rtc_offset.
Add sysctl interface to rtc_offset.
Kill obsolete DST_* macros in sys/time.h
gettimeofday now always returns zeroed timezone if zone is requested.
settimeofday now ignores and logs attempts to set non-existant kernel
timezone.
 1.18  02-Oct-1996  ws branches: 1.18.2;
Fix p_nice vs. NZERO code.
Change NZERO to 20 to always make p_nice positive.
On Christos' suggestion make p_nice explicitly u_char.
 1.17  17-Jul-1996  explorer Add compile-time and run-time control over automatic niceing
 1.16  12-Mar-1996  mrg default DST and TIMEZONE to 0, if not already defined
 1.15  08-Mar-1995  cgd don't do things that should only be necessary for 'real' clists.
 1.14  05-Dec-1994  mycroft Minor style cleanup.
 1.13  30-Aug-1994  mycroft Convert process, file, and namei lists and hash tables to use queue.h.
 1.12  22-Aug-1994  deraadt initialize shmmax to `# of pages' at compile time; multiply by NBPG at
boot time (in shminit). This supports architecture families with varying
values for NBPG, and does not break ipcs.
 1.11  29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.10  27-Jun-1994  cgd new standard, minimally intrusive ID format
 1.9  08-Jun-1994  mycroft Update for 4.4 fs code.
 1.8  21-May-1994  cgd maxfdescs checks out
 1.7  17-May-1994  cgd copyright foo
 1.6  18-Dec-1993  mycroft Canonicalize all #includes.
 1.5  14-Nov-1993  cgd Add the System V message queue and semaphore facilities. Implemented
by Daniel Boulet <danny@BouletFermat.ab.ca>
 1.4  20-May-1993  cgd branches: 1.4.4;
fixed rcsids and cleaned up headers
 1.3  06-May-1993  cgd diffs for uname (posix!) system call, provided by John Brezak <brezak@osf.org>
 1.2  04-Apr-1993  cgd added maxfdescs definition
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3  01-Mar-1998  fvdl Import 4.4BSD-Lite2
 1.1.1.2  01-Mar-1998  fvdl Import 4.4BSD-Lite for reference
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.4.5  23-Nov-1993  glass fix for multiple definition of MAXFDESCS
 1.4.4.4  14-Nov-1993  cgd Update from trunk:
Add the System V message queue and semaphore facilities. Implemented
by Daniel Boulet <danny@BouletFermat.ab.ca>
 1.4.4.3  29-Sep-1993  mycroft Nuke #define of DST.
 1.4.4.2  29-Sep-1993  mycroft Update to roughly 4.4. utsname added (probably should be moved); clist stuff
removed; maxfdescs left in for now. #define of DST added until I figure out
where it's supposed to be coming from.
 1.4.4.1  14-Sep-1993  mycroft files.newconf: Comment out pseudo-device cd for now. Make ufs_* optional
based on `options FFS' (and MFS where appropriate).
param.c: Nuke clist stuff. Remove nbuf and nswbuf, as these are expected
to be in machdep.c. (The wisdom of this is unclear to me, though.)
Incorporate changes from main branch.
 1.18.2.1  18-Jan-1997  thorpej Update from trunk.
 1.20.4.1  12-Mar-1997  is Merge in changes from Trunk
 1.21.4.1  22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.22.2.1  24-Oct-1998  cgd pull up rev 1.25, to fix PR 6293. (jonathan)
 1.25.8.1  21-Jun-1999  thorpej Sync w/ -current.
 1.31.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.31.2.2  22-Nov-2000  bouyer Sync with HEAD.
 1.31.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.35.4.1  13-Nov-2000  tv Pullup 1.37 [mycroft]:
Make SHMSEG much larger to accomodate GNOME and imlib.
It's limited by SHMMAXPGS anyway.
 1.37.4.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.37.4.1  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.37.2.5  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.37.2.4  08-Jan-2002  nathanw Catch up to -current.
 1.37.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.37.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.37.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.38.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.40.16.4  19-Oct-2004  skrll Sync with HEAD
 1.40.16.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.40.16.2  18-Sep-2004  skrll Sync with HEAD.
 1.40.16.1  03-Aug-2004  skrll Sync with HEAD
 1.48.12.5  17-Mar-2008  yamt sync with head.
 1.48.12.4  21-Jan-2008  yamt sync with head
 1.48.12.3  03-Sep-2007  yamt sync with head.
 1.48.12.2  26-Feb-2007  yamt sync with head.
 1.48.12.1  21-Jun-2006  yamt sync with head.
 1.50.20.1  01-Feb-2007  ad Sync with head.
 1.51.8.1  11-Jul-2007  mjf Sync with head.
 1.51.6.1  08-Jun-2007  ad Sync with head.
 1.51.2.1  02-Apr-2007  rmind - Move the ccpu sysctl back to the scheduler-independent part.
- Move the scheduler-independent parts of 4BSD's schedcpu() to
kern_synch.c.
- Add scheduler-specific hook to satisfy individual scheduler's
needs.
- Remove autonice, which is archaic and not useful.

Patch provided by Daniel Sieger.
 1.52.20.1  02-Jan-2008  bouyer Sync with HEAD
 1.52.16.1  13-Dec-2007  ad Eliminate contention on filelist_lock.
 1.52.14.1  18-Feb-2008  mjf Sync with HEAD.
 1.52.8.2  23-Mar-2008  matt sync with HEAD
 1.52.8.1  09-Jan-2008  matt sync with HEAD
 1.53.6.4  17-Jan-2009  mjf Sync with HEAD.
 1.53.6.3  28-Sep-2008  mjf Sync with HEAD.
 1.53.6.2  02-Jul-2008  mjf Sync with HEAD.
 1.53.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.53.2.1  24-Mar-2008  keiichi sync with head.
 1.56.8.2  18-Jul-2008  simonb Sync with head.
 1.56.8.1  03-Jul-2008  simonb Sync with head.
 1.56.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.56.4.2  11-Mar-2010  yamt sync with head
 1.56.4.1  04-May-2009  yamt sync with head.
 1.57.2.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.57.2.1  19-Oct-2008  haad Sync with HEAD.
 1.58.2.2  28-Apr-2009  skrll Sync with HEAD.
 1.58.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.59.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.62.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.63.10.1  30-Oct-2012  yamt sync with head
 1.64.16.3  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.64.16.2  22-Sep-2015  skrll Sync with HEAD
 1.64.16.1  06-Jun-2015  skrll Sync with HEAD
 1.64.2.1  03-Dec-2017  jdolecek update from HEAD
 1.67.18.1  10-Jun-2019  christos Sync with HEAD
 1.67.10.2  06-Feb-2021  martin Pull up following revision(s) (requested by simonb in ticket #1649):

sys/sys/param.h: revision 1.679
sys/conf/param.c: revision 1.69
sys/kern/init_main.c: revision 1.533 (via patch)

Set a better default for MAXFILES on larger RAM machines if not
otherwise specified the kernel config file. Arbitary numbers are
20,000 files for 16GB RAM or more and 10,000 files for 1GB RAM or
more.

TODO: Adjust this and other values totally dynamically.
 1.67.10.1  10-Apr-2019  martin Pull up following revision(s) (requested by pgoyette in ticket #1229):

sys/kern/sysv_ipc.c: revision 1.38
sys/conf/files: revision 1.1233
sys/conf/param.c: revision 1.68

defparam all of the config variables associated with SYSV IPC stuff.

The variables were removed from sys/conf/param.c and moved into the
SYSV IPC code, but config options were never propagated via any opt_*
file.

This should fix an issue reported on netbsd-users list from Dima Veselov.
Note that this does not address other parameters included in that report,
including CHILD_MAX and NOFILE; this commit only affects items related to
the SYSV IPC code. Also note that this does not affect non-built-in
sysv_ipc modules, for which you need to update the Makefile to use any
non-standard config values - just like any other non-built-in modules
which have config params.

XXX Pull-up to -8 and -8-0
XXX Note that there are a couple of panic() calls in msginit() which
XXX really should be changed to simple printf() and then result in
XXX msginit failure. Unfortunately msginit() currently doesn't return
XXX a value so we cannot indicate failure to the caller. I will fix
XXX this is a future commit.
 1.68.12.1  14-Dec-2020  thorpej Sync w/ HEAD.
 1.68.4.1  14-Nov-2020  martin Pull up following revision(s) (requested by fair in ticket #1130):

sys/sys/param.h: revision 1.679
sys/conf/param.c: revision 1.69
sys/kern/init_main.c: revision 1.533

Set a better default for MAXFILES on larger RAM machines if not
otherwise specified the kernel config file. Arbitary numbers are
20,000 files for 16GB RAM or more and 10,000 files for 1GB RAM or
more.

TODO: Adjust this and other values totally dynamically.

RSS XML Feed