1 0 stevel /* 2 0 stevel * CDDL HEADER START 3 0 stevel * 4 0 stevel * The contents of this file are subject to the terms of the 5 5084 johnlev * Common Development and Distribution License (the "License"). 6 5084 johnlev * You may not use this file except in compliance with the License. 7 0 stevel * 8 0 stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 0 stevel * or http://www.opensolaris.org/os/licensing. 10 0 stevel * See the License for the specific language governing permissions 11 0 stevel * and limitations under the License. 12 0 stevel * 13 0 stevel * When distributing Covered Code, include this CDDL HEADER in each 14 0 stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 0 stevel * If applicable, add the following below this CDDL HEADER, with the 16 0 stevel * fields enclosed by brackets "[]" replaced with your own identifying 17 0 stevel * information: Portions Copyright [yyyy] [name of copyright owner] 18 0 stevel * 19 0 stevel * CDDL HEADER END 20 0 stevel */ 21 0 stevel /* Copyright (c) 1988 AT&T */ 22 0 stevel /* All Rights Reserved */ 23 0 stevel /* 24 5084 johnlev * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 25 0 stevel * Use is subject to license terms. 26 0 stevel */ 27 0 stevel 28 0 stevel #ifndef _SYS_VM_MACHPARAM_H 29 0 stevel #define _SYS_VM_MACHPARAM_H 30 0 stevel 31 0 stevel #pragma ident "%Z%%M% %I% %E% SMI" 32 0 stevel 33 0 stevel #ifdef __cplusplus 34 0 stevel extern "C" { 35 0 stevel #endif 36 0 stevel 37 0 stevel /* 38 0 stevel * Machine dependent constants for PC. 39 0 stevel */ 40 0 stevel 41 0 stevel /* 42 0 stevel * USRTEXT is the start of the user text/data space. 43 0 stevel */ 44 0 stevel #define USRTEXT USRSTACK 45 0 stevel 46 0 stevel /* 47 0 stevel * Virtual memory related constants for UNIX resource control, all in bytes. 48 0 stevel * The default stack size (initial stack size limit) keeps the stack from 49 0 stevel * taking more than 2 page directory entries in addition to the part of 50 0 stevel * the page directory entry which also maps the initial text and data, 51 0 stevel * and makes the default slightly bigger than the 8MB on SPARC. 52 0 stevel */ 53 0 stevel #ifdef __amd64 54 0 stevel /* 55 5084 johnlev * On amd64, the stack grows down from just below KERNELBASE (see the 56 5084 johnlev * definition of USERLIMIT in i86pc/sys/machparam.h). Theoretically, 57 5084 johnlev * it could grow down to the top of the VA hole (0xffff800000000000), 58 5084 johnlev * giving it a possible maximum of about 125T. For an amd64 xpv 59 5084 johnlev * kernel, all user VA space is below the VA hole. The theoretical 60 5084 johnlev * maximum for the stack is about the same, although it can't grow 61 5084 johnlev * to quite that size, since it would clash with the heap. 62 5084 johnlev * 63 5084 johnlev * Pick an upper limit that will work in both cases: 32T. 64 5084 johnlev * 65 5084 johnlev * For 32bit processes, the stack is below the text segment. 66 0 stevel */ 67 5084 johnlev #define MAXSSIZ (32ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL) 68 0 stevel #else 69 0 stevel #define MAXSSIZ (USRSTACK - 1024*1024) 70 5084 johnlev #endif /* __amd64 */ 71 0 stevel #define DFLSSIZ (8*1024*1024 + ((USRSTACK) & 0x3FFFFF)) 72 0 stevel 73 0 stevel /* 74 0 stevel * The following are limits beyond which the hard or soft limits for stack 75 0 stevel * and data cannot be increased. These may be viewed as fundamental 76 0 stevel * characteristics of the system. Note: a bug in SVVS requires that the 77 0 stevel * default hard limit be increasable, so the default hard limit must be 78 0 stevel * less than these physical limits. 79 0 stevel */ 80 0 stevel #define DSIZE_LIMIT (USERLIMIT-USRTEXT) /* physical data limit */ 81 0 stevel #define SSIZE_LIMIT (USRSTACK) /* physical stack limit */ 82 0 stevel 83 0 stevel /* 84 0 stevel * Size of the kernel segkmem system pte table. This virtual 85 0 stevel * space is controlled by the resource map "kernelmap". 86 0 stevel */ 87 0 stevel #define SYSPTSIZE ((61*1024*1024) / MMU_PAGESIZE) 88 0 stevel 89 0 stevel /* 90 0 stevel * Size of the ethernet addressable kernel segkmem system pte table. 91 0 stevel * This virtual space is controlled by the resource map "ekernelmap". 92 0 stevel * The ethernet interfaces in some sun machines can address only 93 0 stevel * the upper 16 Megabytes of memory. Since the ethernet 94 0 stevel * driver kmem_allocs its memory, we bias all kmem_allocs 95 0 stevel * to try ekernelmap first and if it fails try kernelmap. 96 0 stevel * Folks that allocate directly out of kernelmap, above, 97 0 stevel * get memory that is non-ethernet addressable. 98 0 stevel */ 99 0 stevel #define E_SYSPTSIZE (0x2000000 / MMU_PAGESIZE) 100 0 stevel 101 0 stevel /* 102 0 stevel * The virtual address space to be used by the seg_map segment 103 0 stevel * driver for fast kernel mappings. 104 0 stevel */ 105 0 stevel #if defined(__i386) 106 0 stevel #define SEGMAPDEFAULT (16 * 1024 * 1024) 107 0 stevel #define SEGMAPMAX (128 * 1024 * 1024) 108 0 stevel #else 109 0 stevel #define SEGMAPDEFAULT (64 * 1024 * 1024) 110 0 stevel #endif 111 0 stevel 112 0 stevel /* 113 0 stevel * The time for a process to be blocked before being very swappable. 114 0 stevel * This is a number of seconds which the system takes as being a non-trivial 115 0 stevel * amount of real time. You probably shouldn't change this; 116 0 stevel * it is used in subtle ways (fractions and multiples of it are, that is, like 117 0 stevel * half of a ``long time'', almost a long time, etc.) 118 0 stevel * It is related to human patience and other factors which don't really 119 0 stevel * change over time. 120 0 stevel */ 121 0 stevel #define MAXSLP 20 122 0 stevel 123 0 stevel /* 124 0 stevel * A swapped in process is given a small amount of core without being bothered 125 0 stevel * by the page replacement algorithm. Basically this says that if you are 126 0 stevel * swapped in you deserve some resources. We protect the last SAFERSS 127 0 stevel * pages against paging and will just swap you out rather than paging you. 128 0 stevel * Note that each process has at least UPAGES pages which are not 129 0 stevel * paged anyways so this number just means a swapped in process is 130 0 stevel * given around 32k bytes. 131 0 stevel */ 132 0 stevel /* 133 0 stevel * nominal ``small'' resident set size 134 0 stevel * protected against replacement 135 0 stevel */ 136 0 stevel #define SAFERSS 3 137 0 stevel 138 0 stevel /* 139 0 stevel * DISKRPM is used to estimate the number of paging i/o operations 140 0 stevel * which one can expect from a single disk controller. 141 0 stevel * 142 0 stevel * XXX - The system doesn't account for multiple swap devices. 143 0 stevel */ 144 0 stevel #define DISKRPM 60 145 0 stevel 146 0 stevel /* 147 0 stevel * The maximum value for handspreadpages which is the the distance 148 0 stevel * between the two clock hands in pages. 149 0 stevel */ 150 0 stevel #define MAXHANDSPREADPAGES ((64 * 1024 * 1024) / PAGESIZE) 151 0 stevel 152 0 stevel /* 153 0 stevel * Paged text files that are less than PGTHRESH bytes 154 0 stevel * may be "prefaulted in" instead of demand paged. 155 0 stevel */ 156 0 stevel #define PGTHRESH (280 * 1024) 157 0 stevel 158 0 stevel #ifdef __cplusplus 159 0 stevel } 160 0 stevel #endif 161 0 stevel 162 0 stevel #endif /* _SYS_VM_MACHPARAM_H */ 163