xref: /titanic_41/usr/src/lib/libbc/inc/include/sun4/vmparam.h (revision 82629e3015252bf18319ba3815c773df23e21436)
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 /*
23  * Copyright (c) 1987-1998,2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _SUN4_VMPARAM_H
28 #define	_SUN4_VMPARAM_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sun4/param.h>
37 
38 /*
39  * Machine dependent constants for Sun-4
40  */
41 
42 /*
43  * USRTEXT is the start of the user text/data space, while USRSTACK
44  * is the top (end) of the user stack.
45  */
46 #define	USRTEXT		0x2000
47 #define	USRSTACK	KERNELBASE
48 
49 /*
50  * Virtual memory related constants for UNIX resource control, all in bytes
51  * The default stack size of 8M allows an optimization of mmu mapping
52  * resources so that in normal use a single mmu region map entry (smeg)
53  * can be used to map both the stack and shared libraries
54  */
55 #define	DFLSSIZ		(8*1024*1024)		/* initial stack size limit */
56 
57 #define	DFLDSIZ_260	((512*1024*1024)-USRTEXT) /* initial data size limit */
58 #define	MAXDSIZ_260	((512*1024*1024)-USRTEXT) /* max data size limit */
59 #define	MAXSSIZ_260	((512*1024*1024)-KERNELSIZE) /* max stack size limit */
60 
61 #define	DFLDSIZ_470	((2048*1024*1024)-USRTEXT) /* initial data size limit */
62 #define	MAXDSIZ_470	((2048*1024*1024)-USRTEXT) /* max data size limit */
63 #define	MAXSSIZ_470	((2048*1024*1024)-KERNELSIZE) /* max stack size limit */
64 
65 #define	DFLDSIZ		dfldsiz
66 #define	MAXDSIZ		maxdsiz
67 #define	MAXSSIZ		maxssiz
68 
69 #ifndef LOCORE
70 extern unsigned int	dfldsiz;
71 extern unsigned int 	maxdsiz;
72 extern unsigned int	maxssiz;
73 #endif /* !LOCORE */
74 
75 #define	SSIZE		1			/* initial stack size */
76 #define	SINCR		1			/* increment of stack */
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	(0x640000 / MMU_PAGESIZE)
83 
84 /*
85  * Minimum allowable virtual address space to be used
86  * by the seg_map segment driver for fast kernel mappings.
87  */
88 #define	MINMAPSIZE	0x200000
89 
90 /*
91  * The time for a process to be blocked before being very swappable.
92  * This is a number of seconds which the system takes as being a non-trivial
93  * amount of real time. You probably shouldn't change this;
94  * it is used in subtle ways (fractions and multiples of it are, that is, like
95  * half of a ``long time'', almost a long time, etc.)
96  * It is related to human patience and other factors which don't really
97  * change over time.
98  */
99 #define	MAXSLP 		20
100 
101 /*
102  * A swapped in process is given a small amount of core without being bothered
103  * by the page replacement algorithm. Basically this says that if you are
104  * swapped in you deserve some resources. We protect the last SAFERSS
105  * pages against paging and will just swap you out rather than paging you.
106  * Note that each process has at least UPAGES pages which are not
107  * paged anyways so this number just means a swapped in process is
108  * given around 32k bytes.
109  */
110 #define	SAFERSS		3
111 
112 /*
113  * DISKRPM is used to estimate the number of paging i/o operations
114  * which one can expect from a single disk controller.
115  */
116 #define	DISKRPM		60
117 
118 /*
119  * Paging thresholds (see vm_pageout.c).
120  * Strategy of 3/17/83:
121  *	lotsfree is 256k bytes, but at most 1/8 of memory
122  *	desfree is 100k bytes, but at most 1/16 of memory
123  *	minfree is 32k bytes, but at most 1/2 of desfree
124  */
125 #define	LOTSFREE	(256 * 1024)
126 #define	LOTSFREEFRACT	8
127 #define	DESFREE		(100 * 1024)
128 #define	DESFREEFRACT	16
129 #define	MINFREE		(32 * 1024)
130 #define	MINFREEFRACT	2
131 
132 /*
133  * There are two clock hands, initially separated by HANDSPREAD bytes
134  * (but at most all of user memory).  The amount of time to reclaim
135  * a page once the pageout process examines it increases with this
136  * distance and decreases as the scan rate rises.
137  */
138 #define	HANDSPREAD	(2 * 1024 * 1024)
139 
140 /*
141  * Paged text files that are less than PGTHRESH bytes
142  * may be "prefaulted in" instead of demand paged.
143  */
144 #define	PGTHRESH	(280 * 1024)
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* !_SUN4_VMPARAM_H */
151