vmparam3.h revision 1.16
11.16Sgwr/* $NetBSD: vmparam3.h,v 1.16 1997/02/27 18:22:54 gwr Exp $ */ 21.9Scgd 31.7Sglass/* 41.10Sgwr * Copyright (c) 1994 Gordon W. Ross 51.7Sglass * Copyright (c) 1993 Adam Glass 61.7Sglass * Copyright (c) 1988 University of Utah. 71.7Sglass * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. 81.7Sglass * All rights reserved. 91.7Sglass * 101.7Sglass * This code is derived from software contributed to Berkeley by 111.7Sglass * the Systems Programming Group of the University of Utah Computer 121.7Sglass * Science Department. 131.7Sglass * 141.7Sglass * Redistribution and use in source and binary forms, with or without 151.7Sglass * modification, are permitted provided that the following conditions 161.7Sglass * are met: 171.7Sglass * 1. Redistributions of source code must retain the above copyright 181.7Sglass * notice, this list of conditions and the following disclaimer. 191.7Sglass * 2. Redistributions in binary form must reproduce the above copyright 201.7Sglass * notice, this list of conditions and the following disclaimer in the 211.7Sglass * documentation and/or other materials provided with the distribution. 221.7Sglass * 3. All advertising materials mentioning features or use of this software 231.7Sglass * must display the following acknowledgement: 241.7Sglass * This product includes software developed by the University of 251.7Sglass * California, Berkeley and its contributors. 261.7Sglass * 4. Neither the name of the University nor the names of its contributors 271.7Sglass * may be used to endorse or promote products derived from this software 281.7Sglass * without specific prior written permission. 291.7Sglass * 301.7Sglass * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 311.7Sglass * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 321.7Sglass * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 331.7Sglass * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 341.7Sglass * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 351.7Sglass * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 361.7Sglass * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 371.7Sglass * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 381.7Sglass * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 391.7Sglass * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 401.7Sglass * SUCH DAMAGE. 411.7Sglass * 421.10Sgwr * from: Utah $Hdr: vmparam.h 1.16 91/01/18$ 431.10Sgwr * from: @(#)vmparam.h 7.3 (Berkeley) 5/7/91 441.10Sgwr * vmparam.h,v 1.2 1993/05/22 07:58:38 cgd Exp 451.7Sglass */ 461.1Sglass 471.10Sgwr/* 481.14Sgwr * Machine dependent constants for Sun3 491.14Sgwr * 501.14Sgwr * The Sun3 has limited total kernel virtual space (32MB) and 511.14Sgwr * can not use main memory for page tables. (All active PTEs 521.14Sgwr * must be installed in special translation RAM in the MMU). 531.14Sgwr * Therefore, parameters that would normally configure the 541.14Sgwr * size of various page tables are irrelevant. Only things 551.14Sgwr * that consume portions of kernel virtual (KV) space matter, 561.14Sgwr * and those things should be chosen to conserve KV space. 571.10Sgwr */ 581.10Sgwr 591.10Sgwr/* 601.14Sgwr * USRTEXT is the start of the user text/data space, while 611.14Sgwr * USRSTACK is the top (end) of the user stack. 621.10Sgwr */ 631.10Sgwr#define USRTEXT NBPG /* Start of user text */ 641.10Sgwr#define USRSTACK KERNBASE /* High end of user stack */ 651.1Sglass 661.1Sglass/* 671.1Sglass * Virtual memory related constants, all in bytes 681.1Sglass */ 691.1Sglass#ifndef MAXTSIZ 701.6Sglass#define MAXTSIZ (8*1024*1024) /* max text size */ 711.1Sglass#endif 721.1Sglass#ifndef DFLDSIZ 731.1Sglass#define DFLDSIZ (8*1024*1024) /* initial data size limit */ 741.1Sglass#endif 751.1Sglass#ifndef MAXDSIZ 761.6Sglass#define MAXDSIZ (32*1024*1024) /* max data size */ 771.1Sglass#endif 781.1Sglass#ifndef DFLSSIZ 791.1Sglass#define DFLSSIZ (512*1024) /* initial stack size limit */ 801.1Sglass#endif 811.1Sglass#ifndef MAXSSIZ 821.10Sgwr#define MAXSSIZ MAXDSIZ /* max stack size */ 831.1Sglass#endif 841.1Sglass 851.1Sglass/* 861.1Sglass * Default sizes of swap allocation chunks (see dmap.h). 871.1Sglass * The actual values may be changed in vminit() based on MAXDSIZ. 881.1Sglass * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024. 891.1Sglass * DMMIN should be at least ctod(1) so that vtod() works. 901.1Sglass * vminit() insures this. 911.1Sglass */ 921.1Sglass#define DMMIN 32 /* smallest swap allocation */ 931.1Sglass#define DMMAX 4096 /* largest potential swap allocation */ 941.1Sglass 951.1Sglass/* 961.4Sglass * PTEs for mapping user space into the kernel for phyio operations. 971.14Sgwr * The actual limitation for physio requests will be the DVMA space, 981.14Sgwr * and that is fixed by hardware design at 1MB. We could make the 991.14Sgwr * physio map larger than that, but it would not buy us much. 1001.4Sglass */ 1011.4Sglass#ifndef USRIOSIZE 1021.14Sgwr#define USRIOSIZE 128 /* 1 MB */ 1031.13Sgwr#endif 1041.13Sgwr 1051.13Sgwr/* 1061.13Sgwr * PTEs for system V style shared memory. 1071.13Sgwr * This is basically slop for kmempt which we actually allocate (malloc) from. 1081.13Sgwr */ 1091.13Sgwr#ifndef SHMMAXPGS 1101.14Sgwr#define SHMMAXPGS 512 /* 4 MB */ 1111.4Sglass#endif 1121.4Sglass 1131.4Sglass/* 1141.1Sglass * The time for a process to be blocked before being very swappable. 1151.1Sglass * This is a number of seconds which the system takes as being a non-trivial 1161.1Sglass * amount of real time. You probably shouldn't change this; 1171.1Sglass * it is used in subtle ways (fractions and multiples of it are, that is, like 1181.1Sglass * half of a ``long time'', almost a long time, etc.) 1191.1Sglass * It is related to human patience and other factors which don't really 1201.1Sglass * change over time. 1211.1Sglass */ 1221.1Sglass#define MAXSLP 20 1231.1Sglass 1241.1Sglass/* 1251.1Sglass * A swapped in process is given a small amount of core without being bothered 1261.1Sglass * by the page replacement algorithm. Basically this says that if you are 1271.1Sglass * swapped in you deserve some resources. We protect the last SAFERSS 1281.1Sglass * pages against paging and will just swap you out rather than paging you. 1291.1Sglass * Note that each process has at least UPAGES+CLSIZE pages which are not 1301.1Sglass * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this 1311.1Sglass * number just means a swapped in process is given around 25k bytes. 1321.1Sglass * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), 1331.1Sglass * so we loan each swapped in process memory worth 100$, or just admit 1341.1Sglass * that we don't consider it worthwhile and swap it out to disk which costs 1351.1Sglass * $30/mb or about $0.75. 1361.1Sglass */ 1371.1Sglass#define SAFERSS 4 /* nominal ``small'' resident set size 1381.1Sglass protected against replacement */ 1391.1Sglass 1401.10Sgwr/* 1411.14Sgwr * Mach-derived constants, virtual memory map: 1421.14Sgwr * 1431.14Sgwr * 0000.0000 user space 1441.14Sgwr * 0E00.0000 kernel space 1451.14Sgwr * 0FE0.0000 monitor map (devices) 1461.14Sgwr * 0FF0.0000 DVMA space 1471.14Sgwr * 0FFE.0000 monitor RAM seg. 1481.14Sgwr * 0FFF.E000 monitor RAM page 1491.1Sglass */ 1501.1Sglass 1511.1Sglass/* user/kernel map constants */ 1521.1Sglass#define VM_MIN_ADDRESS ((vm_offset_t)0) 1531.10Sgwr#define VM_MAX_ADDRESS ((vm_offset_t)KERNBASE) 1541.10Sgwr#define VM_MAXUSER_ADDRESS ((vm_offset_t)KERNBASE) 1551.10Sgwr#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)KERNBASE) 1561.16Sgwr#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)KERN_END) 1571.1Sglass 1581.1Sglass/* virtual sizes (bytes) for various kernel submaps */ 1591.1Sglass#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) 1601.1Sglass#define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES) 1611.1Sglass#define VM_PHYS_SIZE (USRIOSIZE*CLBYTES) 1621.15Sgwr 1631.15Sgwr#define MACHINE_NONCONTIG /* VM <=> pmap interface modifier */ 164