xref: /csrg-svn/sys/tahoe/include/vmparam.h (revision 25678)
1 /*	vmparam.h	1.2	86/01/05	*/
2 
3 /*
4  * Machine dependent constants for TAHOE
5  */
6 /*
7  * USRTEXT is the start of the user text/data space, while USRSTACK
8  * is the top (end) of the user stack.  LOWPAGES and HIGHPAGES are
9  * the number of pages from the beginning of the P0 region to the
10  * beginning of the text and from the beginning of the P2 region to the
11  * beginning of the stack respectively.
12  */
13 #define	USRTEXT		0
14 #define	USRSTACK	(0xc0000000-UPAGES*NBPG) /* Start of user stack */
15 #define	BTOPUSRSTACK	(0x300000 - UPAGES)	 /* btop(USRSTACK) */
16 #define	P2PAGES		0x100000	/* number of pages in P2 region */
17 #define	LOWPAGES	0
18 #define	HIGHPAGES	UPAGES
19 
20 /*
21  * Virtual memory related constants, all in clicks
22  */
23 #define	MAXTSIZ		(6*CLSIZE*1024)		/* max text size */
24 #ifndef DFLDSIZ
25 #define	DFLDSIZ		(6*1024*1024/NBPG)	/* initial data size limit */
26 #endif
27 #ifndef MAXDSIZ
28 #define	MAXDSIZ		(19*1024*1024/NBPG)	/* max data size */
29 #endif
30 #ifndef	DFLSSIZ
31 #define	DFLSSIZ		(512*1024/NBPG)		/* initial stack size limit */
32 #endif
33 #ifndef	MAXSSIZ
34 #define	MAXSSIZ		MAXDSIZ			/* max stack size */
35 #endif
36 
37 /*
38  * Default sizes of swap allocation chunks (see dmap.h).
39  * The actual values may be changed in vminit() based on MAXDSIZ.
40  * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
41  */
42 #define	DMMIN	32			/* smallest swap allocation */
43 #define	DMMAX	4096			/* largest potential swap allocation */
44 #define	DMTEXT	1024			/* swap allocation for text */
45 
46 /*
47  * Sizes of the system and user portions of the system page table.
48  */
49 /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
50 #ifdef notdef
51 #define	SYSPTSIZE	((20+MAXUSERS)*NPTEPG)
52 #define	USRPTSIZE 	(32*NPTEPG)
53 #else
54 #define	SYSPTSIZE	((128*NPTEPG/2)+(MAXUSERS*NPTEPG/16))
55 #define	USRPTSIZE 	(4*NPTEPG)
56 #endif
57 
58 /*
59  * The size of the clock loop.
60  */
61 #define	LOOPPAGES	(maxfree - firstfree)
62 
63 /*
64  * The time for a process to be blocked before being very swappable.
65  * This is a number of seconds which the system takes as being a non-trivial
66  * amount of real time.  You probably shouldn't change this;
67  * it is used in subtle ways (fractions and multiples of it are, that is, like
68  * half of a ``long time'', almost a long time, etc.)
69  * It is related to human patience and other factors which don't really
70  * change over time.
71  */
72 #define	MAXSLP 		20
73 
74 /*
75  * A swapped in process is given a small amount of core without being bothered
76  * by the page replacement algorithm.  Basically this says that if you are
77  * swapped in you deserve some resources.  We protect the last SAFERSS
78  * pages against paging and will just swap you out rather than paging you.
79  * Note that each process has at least UPAGES+CLSIZE pages which are not
80  * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
81  * number just means a swapped in process is given around 25k bytes.
82  * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
83  * so we loan each swapped in process memory worth 100$, or just admit
84  * that we don't consider it worthwhile and swap it out to disk which costs
85  * $30/mb or about $0.75.
86  */
87 #define	SAFERSS		32		/* nominal ``small'' resident set size
88 					   protected against replacement */
89 
90 /*
91  * DISKRPM is used to estimate the number of paging i/o operations
92  * which one can expect from a single disk controller.
93  */
94 #define	DISKRPM		60
95 
96 /*
97  * Klustering constants.  Klustering is the gathering
98  * of pages together for pagein/pageout, while clustering
99  * is the treatment of hardware page size as though it were
100  * larger than it really is.
101  *
102  * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
103  * units.  Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h.
104  */
105 
106 #define	KLMAX	(32/CLSIZE)
107 #define	KLSEQL	(16/CLSIZE)		/* in klust if vadvise(VA_SEQL) */
108 #define	KLIN	(8/CLSIZE)		/* default data/stack in klust */
109 #define	KLTXT	(4/CLSIZE)		/* default text in klust */
110 #define	KLOUT	(32/CLSIZE)
111 
112 /*
113  * KLSDIST is the advance or retard of the fifo reclaim for sequential
114  * processes data space.
115  */
116 #define	KLSDIST	3		/* klusters advance/retard for seq. fifo */
117 
118 /*
119  * Paging thresholds (see vm_sched.c).
120  * Strategy of 1/19/85:
121  *	lotsfree is 512k bytes, but at most 1/4 of memory
122  *	desfree is 200k bytes, but at most 1/8 of memory
123  *	minfree is 64k bytes, but at most 1/2 of desfree
124  */
125 #define	LOTSFREE	(512 * 1024)
126 #define	LOTSFREEFRACT	4
127 #define	DESFREE		(200 * 1024)
128 #define	DESFREEFRACT	8
129 #define	MINFREE		(64 * 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  * The number of times per second to recompute the desired paging rate
142  * and poke the pagedaemon.
143  */
144 #define	RATETOSCHEDPAGING	4
145 
146 /*
147  * Believed threshold (in megabytes) for which interleaved
148  * swapping area is desirable.
149  */
150 #define	LOTSOFMEM	2
151 
152 /*
153  * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1
154  */
155 #define	mapin(pte, v, pfnum, count, prot) \
156 	(*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))
157 
158 /*
159  * Invalidate a cluster (optimized here for standard CLSIZE).
160  */
161 #if CLSIZE == 1
162 #define	tbiscl(v)	mtpr(TBIS, ptob(v))
163 #endif
164 
165 /*
166  * The following constant is used to initialize the map of the
167  * system page table i/o entries.
168  * It's value should be the highest i/o address used by all the
169  * controllers handled in the system as specified in ubminit
170  * structure in ioconf.c.
171  */
172 #define MAXIOADDR	0xffffee45
173 /* number of entries in the system page pable for i/o space */
174 #define IOSIZE		(((MAXIOADDR - (int)IOBASE+ NBPG-1) >> PGSHIFT)+1)
175 #define TBUFSIZ		32		/* maximum tape buffer size */
176 #define	ACEBPTE		32		/* ACC Ethernet (ACE) I/O window */
177