Commit Graph

64 Commits

Author SHA1 Message Date
christos 0461089547 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.
2012-06-09 02:31:14 +00:00
joerg d621e29eca 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.
2010-02-08 19:02:25 +00:00
elad 414eb0a314 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
2009-05-03 21:25:44 +00:00
pooka fb42667d02 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)
2009-05-02 14:13:28 +00:00
joerg f5b0fec0e0 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.
2009-03-06 20:31:46 +00:00
ad 0b7375c9af Allow the POSIX semaphore code to be loaded as a module. 2008-11-12 14:32:34 +00:00
gmcgarry fb80c8cd2d Disable INCLUDE_CONFIG_FILE if compiling with PCC, since PCC cannot
handle 80KB string literals.  Documented as hack.
2008-07-12 11:50:07 +00:00
ad b94f79f0e8 Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@. 2008-07-02 17:28:54 +00:00
ad f280ebae4b ALIGNBYTES + 1, not ALIGNBYTES in previous. 2008-03-27 18:44:21 +00:00
ad 0f33676c6c Introduce COHERENCY_UNIT/coherency_unit as proposed on tech-kern. 2008-03-27 18:28:20 +00:00
ad 3bd2b6fba5 Add a 'maxcpus' global. 2008-03-15 14:55:22 +00:00
ad ea3f10f7e0 Merge more changes from vmlocking2, mainly:
- Locking improvements.
- Use pool_cache for more items.
2007-12-26 16:01:34 +00:00
yamt f03010953f 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.
2007-05-17 14:51:11 +00:00
ad 965759e2d5 Remove long unused 'ncallout'. 2007-01-20 20:00:13 +00:00
yamt fcae6339ea defparam NMBCLUSTERS. 2005-12-21 10:57:22 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
christos d7f20abdc1 Disable autonicetime. As discusses in tech-kern. 2004-09-27 14:08:13 +00:00
yamt 34ed9bd392 avoid divide-by-zero in adjtime1() in the case of HZ > 6000. 2004-07-01 12:57:37 +00:00
yamt 3998262d5e defparam HZ. 2004-07-01 12:44:26 +00:00
martin 63095bc32c s/NBPG/PAGE_SIZE/ in a comment.
From Jeff Ito in PR kern/23935.
2003-12-31 12:34:22 +00:00
pk 70f20a1217 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.
2003-12-30 12:33:13 +00:00
drochner 559255f8db there is no SHMMMNI 2003-10-30 20:37:01 +00:00
thorpej 4011fcfefd 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.
2003-10-21 22:55:47 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
atatat 5ba4387372 Provide hooks to include the config file(s) in the kernel binary. 2001-12-17 15:40:43 +00:00
lukem 27cc5a5d37 add RCSID 2001-11-08 05:59:31 +00:00
mrg b734a361cf allow SHMMAX, SHMMIN, SHMMNI and SHMSEG to be specified in the kernel config file. 2001-08-20 04:51:17 +00:00
mycroft e43fd45f1a Make SHMSEG much larger to accomodate GNOME and imlib.
It's limited by SHMMAXPGS anyway.
2000-11-11 02:24:55 +00:00
jdolecek 5c369e4610 defopt SHMMAXPGS, SEMMNI, SEMMNS, SEMUME and SEMMNU 2000-09-24 18:45:37 +00:00
simonb dd06794f0b Remove shmsegs declaration from conf/param.c - it doesn't belong here.
Instead, put it in kern/sysv_shm.c.
2000-04-15 16:49:35 +00:00
simonb 841d52b4e5 Declare the SysV IPC *info structures and shmsegs pointer as extern.
Add declaration for shmsegs to param.c after shminfo structure.
2000-03-28 05:14:03 +00:00
thorpej 7b918b4088 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.
2000-03-23 06:40:33 +00:00
ragge 8598795248 CL* discarding. 1999-12-04 10:55:11 +00:00
lukem 5ef2870d85 remove nbuf, nswbuf. cleanup def of AUTONICE(TIME|VAL) 1999-05-20 06:03:01 +00:00
cgd 36e7791991 g.c. now-unneeded variable declarations (cfree, swbuf, utsname 1999-05-20 05:35:28 +00:00
thorpej c92294ac82 Add `mblowat' and `mcllowat' low water mark variables for mbufs and mbuf
clusters.
1999-04-26 21:53:59 +00:00
simonb 1a2458f405 Const msize & mclbytes. 1999-04-25 04:51:53 +00:00
simonb 5d8b1ef3e4 g/c REAL_CLISTS. 1999-04-25 02:56:26 +00:00
simonb 8ce41be7b0 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.
1999-04-22 04:50:05 +00:00
jonathan 9a06d5e2a6 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.
1998-10-23 19:37:32 +00:00
tron 39876df951 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:14:54 +00:00
mrg 1a8c7604f4 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.  :-)
1998-02-05 07:59:28 +00:00
enami 8a45521059 Convert RTC_OFFSET, DEVPAGER, SWAPPAGER and VNODEPAGER to be declared
by defopt.
1997-09-20 00:44:05 +00:00
jonathan f0f7e53290 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.
1997-02-28 00:14:19 +00:00
tls a6b42c4d73 fix a large number of braindead unconditional #defines 1997-01-30 10:16:18 +00:00
perry b89a3425b7 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.
1997-01-15 01:28:28 +00:00
ws 2da166f660 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.
1996-10-02 18:04:56 +00:00
explorer 471c23385f Add compile-time and run-time control over automatic niceing 1996-07-17 21:43:22 +00:00
mrg a8554128fc default DST and TIMEZONE to 0, if not already defined 1996-03-12 03:08:40 +00:00
cgd b6dc9e0984 don't do things that should only be necessary for 'real' clists. 1995-03-08 00:54:44 +00:00