📄 d.t
字号:
.\" Copyright (c) 1983, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)d.t 8.1 (Berkeley) 6/8/93.\".\".ds RH "Data Structure Sizing Rules.bp.LG.B.ceAPPENDIX D. VAX KERNEL DATA STRUCTURE SIZING RULES.sp.R.NL.PPCertain system data structures are sized at compile timeaccording to the maximum number of simultaneous users expected,while others are calculated at boot time based on thephysical resources present, e.g. memory. This appendix listsboth sets of rules and also includes some hints on changingbuilt-in limitations on certain data structures..SHCompile time rules.PPThe file \fI/sys/conf\|/param.c\fP contains the definitions ofalmost all data structures sized at compile time. This fileis copied into the directory of each configured system to allowconfiguration-dependent rules and values to be maintained.(Each copy normally depends on the copy in /sys/conf,and global modifications cause the file to be recopied unlessthe makefile is modified.)The rules implied by its contents are summarized below (hereMAXUSERS refers to the value defined in the configuration filein the ``maxusers'' rule).Most limits are computed at compile time and stored in global variablesfor use by other modules; they may generally be patched in the systembinary image before rebooting to test new values..IP \fBnproc\fP.brThe maximum number of processes which may be running at any time.It is referred to in other calculations as NPROC and is defined to be.DS20 + 8 * MAXUSERS.DE.IP \fBntext\fP.brThe maximum number of active shared text segments.The constant is intended to allow for network servers and common commandsthat remain in the table.It is defined as.DS36 + MAXUSERS..DE.IP \fBninode\fP.brThe maximum number of files in the file system which may beactive at any time. This includes files in use by users, as well as directory files being read or written by the systemand files associated with bound sockets in the UNIX IPC domain.It is defined as.DS(NPROC + 16 + MAXUSERS) + 32.DE.IP \fBnfile\fP.brThe number of ``file table'' structures. One filetable structure is used for each open, unshared, file descriptor.Multiple file descriptors may reference a single file tableentry when they are created through a \fIdup\fP call, or as theresult of a \fIfork\fP. This is defined to be.DS16 * (NPROC + 16 + MAXUSERS) / 10 + 32.DE.IP \fBncallout\fP.brThe number of ``callout'' structures. One calloutstructure is used per internal system event handled witha timeout. Timeouts are used for terminal delays,watchdog routines in device drivers, protocol timeout processing, etc.This is defined as.DS16 + NPROC.DE.IP \fBnclist\fP.brThe number of ``c-list'' structures. C-list structures areused in terminal I/O, and currently each holds 60 characters.Their number is defined as.DS60 + 12 * MAXUSERS.DE.IP \fBnmbclusters\fP.brThe maximum number of pages which may be allocated by the network. This is defined as 256 (a quarter megabyte of memory) in /sys/h/mbuf.h.In practice, the network rarely uses this much memory. It starts offby allocating 8 kilobytes of memory, then requesting more as required. This value represents an upper bound..IP \fBnquota\fP.brThe number of ``quota'' structures allocated. Quota structuresare present only when disc quotas are configured in the system. Onequota structure is kept per user. This is defined to be.DS(MAXUSERS * 9) / 7 + 3.DE.IP \fBndquot\fP.brThe number of ``dquot'' structures allocated. Dquot structuresare present only when disc quotas are configured in the system.One dquot structure is required per user, per active file system quota.That is, when a user manipulates a file on a file system on whichquotas are enabled, the information regarding the user's quotas onthat file system must be in-core. This information is cached, sothat not all information must be present in-core all the time.This is defined as.DSNINODE + (MAXUSERS * NMOUNT) / 4.DEwhere NMOUNT is the maximum number of mountable file systems..LPIn addition to the above values, the system page tables (used tomap virtual memory in the kernel's address space) are sized atcompile time by the SYSPTSIZE definition in the file /sys/vax/vmparam.h.This is defined to be.DS20 + MAXUSERS.DEpages of page tables. Its definition affectsthe size of many data structures allocated at boot time becauseit constrains the amount of virtual memory which may be addressedby the running system. This is often the limiting factorin the size of the buffer cache, in which case a message is printedwhen the system configures at boot time..SHRun-time calculations.PPThe most important data structures sized at run-time are those used inthe buffer cache. Allocation is done by allocating physical memory(and system virtual memory) immediately after the systemhas been started up; look in the file /sys/vax/machdep.c.The amount of physical memory which may be allocated to the buffercache is constrained by the size of the system page tables, amongother things. While the system may calculatea large amount of memory to be allocated to the buffer cache,if the system pagetable is too small to map this physicalmemory into the virtual address spaceof the system, only as much as can be mapped will be used..PPThe buffer cache is comprised of a number of ``buffer headers''and a pool of pages attached to these headers. Buffer headersare divided into two categories: those used for swapping andpaging, and those used for normal file I/O. The system triesto allocate 10% of the first two megabytes and 5% of the remainingavailable physical memory for the buffercache (where \fIavailable\fP does not count that space occupied bythe system's text and data segments). If this results in fewerthan 16 pages of memory allocated, then 16 pages are allocated.This value is kept in the initialized variable \fIbufpages\fPso that it may be patched in the binary image (to allow tuningwithout recompiling the system),or the default may be overridden with a configuration-file option.For example, the option \fBoptions BUFPAGES="3200"\fPcauses 3200 pages (3.2M bytes) to be used by the buffer cache.A sufficient number of file I/O buffer headers are then allocatedto allow each to hold 2 pages each.Each buffer maps 8K bytes.If the number of buffer pages is larger than can be mappedby the buffer headers, the number of pages is reduced.The number of buffer headers allocatedis stored in the global variable \fInbuf\fP,which may be patched before the system is booted.The system option \fBoptions NBUF="1000"\fP forces the allocationof 1000 buffer headers.Half as many swap I/O buffer headers as file I/O buffersare allocated,but no more than 256..SHSystem size limitations.PPAs distributed, the sum of the virtual sizes of the core-residentprocesses is limited to 256M bytes. The size of the textsegment of a single process is currently limited to 6M bytes.It may be increased to no greater than the data segment size limit(see below) by redefining MAXTSIZ.This may be done with a configuration file option,e.g. \fBoptions MAXTSIZ="(10*1024*1024)"\fPto set the limit to 10 million bytes.Other per-process limits discussed here may be changed with similar optionswith names given in parentheses.Soft, user-changeable limits are set to 512K bytes for stack (DFLSSIZ)and 6M bytes for the data segment (DFLDSIZ) by default;these may be increased up to the hard limitwith the \fIsetrlimit\fP\|(2) system call.The data and stack segment size hard limits are set by a system configurationoption to one of 17M, 33M or 64M bytes.One of these sizes is chosen based on the definition of MAXDSIZ;with no option, the limit is 17M bytes; with an option\fBoptions MAXDSIZ="(32*1024*1024)"\fP (or any value between 17M and 33M),the limit is increased to 33M bytes, and values larger than 33Mresult in a limit of 64M bytes.You must be careful in doing this that you have adequate paging space.As normally configured , the system has 16M or 32M bytes per paging area,depending on disk size.The best way to get more space is to provide multiple, therebyinterleaved, paging areas.Increasing the virtual memory limits results in interleaving ofswap space in larger sections (from 500K bytes to 1M or 2M bytes)..PPBy default, the virtual memory system allocates enough memoryfor system page tables mapping user page tablesto allow 256 megabytes of simultaneous active virtual memory.That is, the sum of the virtual memory sizes of all (completely- or partially-)resident processes can not exceed this limit.If the limit is exceeded, some process(es) must be swapped out.To increase the amount of resident virtual space possible,you can alter the constant USRPTSIZE (in/sys/vax/vmparam.h).Each page of system page tables allows 8 megabytes of user virtual memory..PPBecause the file system block numbers are stored inpage table \fIpg_blkno\fPentries, the maximum size of a file system is limited to2^24 1024 byte blocks. Thus no file system can be larger than 8 gigabytes..PPThe number of mountable file systems is set at 20 by the definitionof NMOUNT in /sys/h/param.h.This should be sufficient; if not, the value can be increased up to 255.If you have many disks, it makes sense to make some ofthem single file systems, and the paging areas don't count in this total..PPThe limit to the number of files that a process may have open simultaneouslyis set to 64.This limit is set by the NOFILE definition in /sys/h/param.h.It may be increased arbitrarily, with the caveat that the user structureexpands by 5 bytes for each file, and thus UPAGES (/sys/vax/machparam.h)must be increased accordingly..PPThe amount of physical memory is currently limited to 64 Mbby the size of the index fields in the core-map (/sys/h/cmap.h).The limit may be increased by following instructions in that fileto enlarge those fields.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -