summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_param.c
Commit message (Collapse)AuthorAgeFilesLines
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderps2001-10-101-0/+21
| | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks
* Conditionalize VM_SWZONE_SIZE_MAX and VM_BCACHE_SIZE_MAX so MD sectionsdillon2001-08-201-0/+4
| | | | that don't define these constants don't break.
* Limit the amount of KVM reserved for the buffer cache and for swap-metadillon2001-08-201-0/+6
| | | | | | | | | | | | | | | information. The default limits only effect machines with > 1GB of ram and can be overriden with two new kernel conf variables VM_SWZONE_SIZE_MAX and VM_BCACHE_SIZE_MAX, or with loader variables kern.maxswzone and kern.maxbcache. This has the effect of leaving more KVM available for sizing NMBCLUSTERS and 'maxusers' and should avoid tripups where a sysad adds memory to a machine and then sees the kernel panic on boot due to running out of KVM. Also change the default swap-meta auto-sizing calculation to allocate half of what it was previously allocating. The prior defaults were way too high. Note that we cannot afford to run out of swap-meta structures so we still stay somewhat conservative here.
* Move param.c out of the conf directory and make it fully dynamic.peter2001-07-261-27/+49
| | | | | | Tunables are now derived at boot time from maxusers. ie: change maxusers via a tunable and all the derivative settings change. You can change the other tunables individually as well. Even hz etc is tunable.
* Introduce numerous SMP friendly changes to the mbuf allocator. Namely,bmilekic2001-06-221-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce a modified allocation mechanism for mbufs and mbuf clusters; one which can scale under SMP and which offers the possibility of resource reclamation to be implemented in the future. Notable advantages: o Reduce contention for SMP by offering per-CPU pools and locks. o Better use of data cache due to per-CPU pools. o Much less code cache pollution due to excessively large allocation macros. o Framework for `grouping' objects from same page together so as to be able to possibly free wired-down pages back to the system if they are no longer needed by the network stacks. Additional things changed with this addition: - Moved some mbuf specific declarations and initializations from sys/conf/param.c into mbuf-specific code where they belong. - m_getclr() has been renamed to m_get_clrd() because the old name is really confusing. m_getclr() HAS been preserved though and is defined to the new name. No tree sweep has been done "to change the interface," as the old name will continue to be supported and is not depracated. The change was merely done because m_getclr() sounds too much like "m_get a cluster." - TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and systat(1) (see TODO below). - Fixed systat(1) to display number of "free mbufs" based on new per-CPU stat structures. - Fixed netstat(1) to display new per-CPU stats based on sysctl-exported per-CPU stat structures. All infos are fetched via sysctl. TODO (in order of priority): - Re-enable mbtypes statistics in both netstat(1) and systat(1) after introducing an SMP friendly way to collect the mbtypes stats under the already introduced per-CPU locks (i.e. hopefully don't use atomic() - it seems too costly for a mere stat update, especially when other locks are already present). - Optionally have systat(1) display not only "total free mbufs" but also "total free mbufs per CPU pool." - Fix minor length-fetching issues in netstat(1) related to recently re-enabled option to read mbuf stats from a core file. - Move reference counters at least for mbuf clusters into an unused portion of the cluster itself, to save space and need to allocate a counter. - Look into introducing resource freeing possibly from a kproc. Reviewed by (in parts): jlemon, jake, silby, terry Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha) Preliminary performance measurements: jlemon (and me, obviously) URL: http://people.freebsd.org/~bmilekic/mb_alloc/
* Remove unneeded <stddef.h> #includes.phk2000-10-291-2/+0
|
* For lockmgr mutex protection, use an array of mutexes that are allocatedjasone2000-10-121-0/+8
| | | | | | | | | and initialized during boot. This avoids bloating sizeof(struct lock). As a side effect, it is no longer necessary to enforce the assumtion that lockinit()/lockdestroy() calls are paired, so the LK_VALID flag has been removed. Idea taken from: BSD/OS.
* Move the MSG* and SEM* options to opt_sysvipc.hpeter2000-05-011-45/+0
| | | | | | | | | | | | | | | Remove evil allocation macros from machdep.c (why was that there???) and use malloc() instead. Move paramters out of param.h and into the code itself. Move a bunch of internal definitions from public sys/*.h headers (without #ifdef _KERNEL even) into the code itself. I had hoped to make some of this more dynamic, but the cost of doing wakeups on all sleeping processes on old arrays was too frightening. The other possibility is to initialize on the first use, and allow dynamic sysctl changes to parameters right until that point. That would allow /etc/rc.sysctl to change SEM* and MSG* defaults as we presently do with SHM*, but without the nightmare of changing a running system.
* Make sysv-style shared memory tuneable params fully runtime adjustablepeter2000-03-301-33/+0
| | | | | | | | via sysctl. It's done pretty simply but it should be quite adequate. Also move SHMMAXPGS from $machine/include/vmparam.h as the comments that went with it were wrong... we don't allocate KVM space for the pages so that comment is bogus.. The only practical limit is how much physical ram you want to lock up as this stuff isn't paged out or swap backed.
* This is Bosko Milekic's mbuf allocation waiting code. Basically, thisgreen1999-12-121-0/+1
| | | | | | | | means that running out of mbuf space isn't a panic anymore, and code which runs out of network memory will sleep to wait for it. Submitted by: Bosko Milekic <bmilekic@dsuper.net> Reviewed by: green, wollman
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Move the initialisation/tuning of nmbclusters from param.c/machdep.cmsmith1999-07-051-17/+1
| | | | | | | | | | | | | | | into uipc_mbuf.c. This reduces three sets of identical tunable code to one set, and puts the initialisation with the mbuf code proper. Make NMBUFs tunable as well. Move the nmbclusters sysctl here as well. Move the initialisation of maxsockets from param.c to uipc_socket2.c, next to its corresponding sysctl. Use the new tunable macros for the kern.vm.kmem.size tunable (this should have been in a separate commit, whoops).
* Allow setting MAXFILES in the kernel config.des1999-04-091-1/+3
|
* Fixed problems with kernel config file overrides of sysv semaphoredillon1998-12-141-1/+3
| | | | | | | parameters. Prior to this fix a kernel config override would effect only some of the kernel files, resulting in panics. PR: kern/9068
* Implemented zero-copy TCP/IP extensions via sendfile(2) - send adg1998-11-051-1/+7
| | | | | | | | | | | file to a stream socket. sendfile(2) is similar to implementations in HP-UX, Linux, and other systems, but the API is more extensive and addresses many of the complaints that the Apache Group and others have had with those other implementations. Thanks to Marc Slemko of the Apache Group for helping me work out the best API for this. Anyway, this has the "net" result of speeding up sends of files over TCP/IP sockets by about 10X (that is to say, uses 1/10th of the CPU cycles) when compared to a traditional read/write loop.
* Moved definition of fscale from param.c to kern_synch.c where itbde1998-07-111-6/+1
| | | | | should always have been (it has no user-servicable parts even at compile time) and staticized it.
* Add 3 sysctl variables for future use by ps)1_phk1998-06-301-1/+4
|
* Round tickadj up. This prevents tickadj from being 0 when HZ > 500,bde1998-06-211-2/+2
| | | | | | | | | which makes adjtime(2) useless and confuses xntpd(8) into refusing to start even when it would use the kernel PLL instead of adjtime(). The result is the same as recommended by tickadj(8), at least when HZ divides 10^6. Of course, you wouldn't want to actually use adjtime() when HZ is large. In the silly boundary case of HZ == 10^6, tickadj == tick == 1 so the clock stops while adjtime() is active.
* Convert socket structures to be type-stable and add a version number.wollman1998-05-151-1/+8
| | | | | | | | | | | | | | | | | | | Define a parameter which indicates the maximum number of sockets in a system, and use this to size the zone allocators used for sockets and for certain PCBs. Convert PF_LOCAL PCB structures to be type-stable and add a version number. Define an external format for infomation about socket structures and use it in several places. Define a mechanism to get all PF_LOCAL and PF_INET PCB lists through sysctl(3) without blocking network interrupts for an unreasonable length of time. This probably still has some bugs and/or race conditions, but it seems to work well enough on my machines. It is now possible for `netstat' to get almost all of its information via the sysctl(3) interface rather than reading kmem (changes to follow).
* Raise ncallout from NPROC + 16 to NPROC + 16 + MAXFILES. This sholdguido1998-02-271-4/+5
| | | | | | prevent a possible DOS attack. The proper fix (to dynamically grow the callout list) is in the make. Submitted by: Paul Traina
* Removed unused #includes.bde1997-06-141-12/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Removed option EXTRAVNODES. All versions of FreeBSD-2.x have a sysctlbde1997-01-161-5/+0
| | | | | | variable `kern.maxvnodes' which gives much better control over vnode allocation than EXTRAVNODES (except in -current between 1995/10/28 and 1996/11/12, kern.maxvnodes was read-only and thus useless).
* Fix bug related to map entry allocations where a sleep might be attempteddg1997-01-151-2/+2
| | | | | | | | when allocating memory for network buffers at interrupt time. This is due to inadequate checking for the new mcl_map. Fixed by merging mb_map and mcl_map into a single mb_map. Reviewed by: wollman
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Add an option "EXTRA_VNODES" to cause an extra number of vnode structurespeter1996-05-311-1/+6
| | | | | | | | | | | | | | | | to be allocated at boot time. This is an expensive option, as they consume physical ram and are not pageable etc. In certain situations, this kind of option is quite useful, especially for news servers that access a large number of directories at random and torture the name cache. Defining 5000 or 10000 extra vnodes should cut down the amount of vnode recycling somewhat, which should allow better name and directory caching etc. This is a "your mileage may vary" option, with no real indication of what works best for your machine except trial and error. Too many will cost you ram that you could otherwise use for disk buffers etc. This is based on something John Dyson mentioned to me a while ago.
* Allocate mbufs from a separate submap so that NMBCLUSTERS works aswollman1996-05-101-4/+6
| | | | expected.
* removed:phk1996-05-021-2/+2
| | | | | | | | | CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei() ptei() kvtopte() ptetov() ispt() ptetoav() &c &c new: NPDEPG Major macro cleanup.
* First pass at cleaning up macros relating to pages, clusters and all that.phk1996-05-021-2/+2
|
* Merge in Lite2: proc LIST changes.hsu1996-03-111-27/+2
| | | | Reviewed by: david & bde
* Add more options into the conf/options and i386/conf/options.i386 filespeter1996-03-021-1/+2
| | | | | | and the #include hooks so that 'make depend' is more useful. This covers most of the options I regularly use (but not all) and some other easy ones.
* Convert SYSV IPC to new-style options. (I hope I got everything...)wollman1996-01-041-3/+5
| | | | The LKMs will need an extra file, to come later.
* Last commit this round: Staticize.phk1995-12-101-3/+1
| | | | | we are now down to about 1146 symbols being global, of which I estimate that about 100 are validly so.
* Eliminate sloppy common-style declarations. There should be none left forbde1995-07-291-6/+11
| | | | the LINT configuation.
* Removed "GATEWAY" consideration when calculating number of mbuf clusters.dg1995-06-291-5/+1
| | | | It now always uses the value that was used for the GATEWAY case.
* Killed "TIMEZONE" and "DST" options. They have been forced to 0 by configdg1995-06-291-3/+2
| | | | for more than a year now. Moved the declaration of 'tz' into kern_time.c.
* Made "NMBCLUSTERS" calculation dynamic and fixed bogus use of "NMBCLUSTERS"dg1995-05-251-2/+13
| | | | | | | | | | | | in machdep.c (it should use the global nmbclusters). Moved the calculation of nmbclusters into conf/param.c (same place where nmbclusters has always been assigned), and made the calculation include an extra amount based on "maxusers". NMBCLUSTERS can still be overrided in the kernel config file as always, but this change will make that generally unnecessary. This fixes the "bug" reports from people who have misconfigured kernels seeing the network "hang" when the mbuf cluster pool runs out. Reviewed by: John Dyson
* Implement maxprocperuid and maxfilesperproc. They are tunableguido1995-02-201-1/+3
| | | | | | | | | | | | via sysctl(8). The initial value of maxprocperuid is maxproc-1, that of maxfilesperproc is maxfiles (untill maxfile will disappear) Now it is at least possible to prohibit one user opening maxfiles -Guido Submitted by: Obtained from:
* Alow overriding of the various SHM* options.joerg1995-02-161-1/+11
| | | | Submitted by: Heikki Suonsivu <hsu@fx7.cs.hut.fi>
* Increase maxfiles to NPROC*2. This makes the per-process open file limitdg1995-01-121-2/+2
| | | | highly bogus, however, and this needs to be fixed.
* These changes embody the support of the fully coherent merged VM buffer cache,dg1995-01-091-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | much higher filesystem I/O performance, and much better paging performance. It represents the culmination of over 6 months of R&D. The majority of the merged VM/cache work is by John Dyson. The following highlights the most significant changes. Additionally, there are (mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to support the new VM/buffer scheme. vfs_bio.c: Significant rewrite of most of vfs_bio to support the merged VM buffer cache scheme. The scheme is almost fully compatible with the old filesystem interface. Significant improvement in the number of opportunities for write clustering. vfs_cluster.c, vfs_subr.c Upgrade and performance enhancements in vfs layer code to support merged VM/buffer cache. Fixup of vfs_cluster to eliminate the bogus pagemove stuff. vm_object.c: Yet more improvements in the collapse code. Elimination of some windows that can cause list corruption. vm_pageout.c: Fixed it, it really works better now. Somehow in 2.0, some "enhancements" broke the code. This code has been reworked from the ground-up. vm_fault.c, vm_page.c, pmap.c, vm_object.c Support for small-block filesystems with merged VM/buffer cache scheme. pmap.c vm_map.c Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of kernel PTs. vm_glue.c Much simpler and more effective swapping code. No more gratuitous swapping. proc.h Fixed the problem that the p_lock flag was not being cleared on a fork. swap_pager.c, vnode_pager.c Removal of old vfs_bio cruft to support the past pseudo-coherency. Now the code doesn't need it anymore. machdep.c Changes to better support the parameter values for the merged VM/buffer cache scheme. machdep.c, kern_exec.c, vm_glue.c Implemented a seperate submap for temporary exec string space and another one to contain process upages. This eliminates all map fragmentation problems that previously existed. ffs_inode.c, ufs_inode.c, ufs_readwrite.c Changes for merged VM/buffer cache. Add "bypass" support for sneaking in on busy buffers. Submitted by: John Dyson and David Greenman
* Added SYSV ipcs.dfr1994-09-131-1/+44
| | | | Obtained from: NetBSD and FreeBSD-1.1.5
* Added $Id$dg1994-08-021-0/+1
|
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-1/+2
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+145
OpenPOWER on IntegriCloud