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