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