|
|
1.1 root 1: /*
2: * Copyright (c) 1988 University of Utah.
3: * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
4: * All rights reserved.
5: *
6: * This code is derived from software contributed to Berkeley by
7: * the Systems Programming Group of the University of Utah Computer
8: * Science Department.
9: *
10: * Redistribution is only permitted until one year after the first shipment
11: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
12: * binary forms are permitted provided that: (1) source distributions retain
13: * this entire copyright notice and comment, and (2) distributions including
14: * binaries display the following acknowledgement: This product includes
15: * software developed by the University of California, Berkeley and its
16: * contributors'' in the documentation or other materials provided with the
17: * distribution and in all advertising materials mentioning features or use
18: * of this software. Neither the name of the University nor the names of
19: * its contributors may be used to endorse or promote products derived from
20: * this software without specific prior written permission.
21: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
22: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
23: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
24: *
25: * from: Utah $Hdr: vmparam.h 1.14 89/08/14$
26: *
27: * @(#)vmparam.h 7.1 (Berkeley) 5/8/90
28: */
29:
30: /*
31: * Machine dependent constants for HP300
32: */
33: /*
34: * USRTEXT is the start of the user text/data space, while USRSTACK
35: * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are
36: * the number of pages from the beginning of the P0 region to the
37: * beginning of the text and from the beginning of the P1 region to the
38: * beginning of the stack respectively.
39: *
40: * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3)
41: * is for HPUX compatibility. Why?? Because HPUX's debuggers
42: * have the user's stack hard-wired at FFF00000 for post-mortems,
43: * and we must be compatible...
44: */
45: #define USRTEXT 0
46: #define USRSTACK (-HIGHPAGES*NBPG) /* Start of user stack */
47: #define BTOPUSRSTACK (0x100000-HIGHPAGES) /* btop(USRSTACK) */
48: #define P1PAGES 0x100000
49: #define LOWPAGES 0
50: #define HIGHPAGES (0x100000/NBPG)
51:
52: /*
53: * Virtual memory related constants, all in bytes
54: */
55: #ifndef MAXTSIZ
56: #define MAXTSIZ (6*1024*1024) /* max text size */
57: #endif
58: #ifndef DFLDSIZ
59: #define DFLDSIZ (8*1024*1024) /* initial data size limit */
60: #endif
61: #ifndef MAXDSIZ
62: #define MAXDSIZ (16*1024*1024) /* max data size */
63: #endif
64: #ifndef DFLSSIZ
65: #define DFLSSIZ (512*1024) /* initial stack size limit */
66: #endif
67: #ifndef MAXSSIZ
68: #define MAXSSIZ MAXDSIZ /* max stack size */
69: #endif
70:
71: /*
72: * Default sizes of swap allocation chunks (see dmap.h).
73: * The actual values may be changed in vminit() based on MAXDSIZ.
74: * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
75: * DMMIN should be at least ctod(1) so that vtod() works.
76: * vminit() insures this.
77: */
78: #define DMMIN 32 /* smallest swap allocation */
79: #define DMMAX 4096 /* largest potential swap allocation */
80: #define DMTEXT 1024 /* swap allocation for text */
81:
82: /*
83: * Sizes of the system and user portions of the system page table.
84: */
85: /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
86: #define SYSPTSIZE (2 * NPTEPG)
87: #define USRPTSIZE (1 * NPTEPG)
88:
89: /*
90: * PTEs for mapping user space into kernel for phyio operations.
91: * One page is enough to handle 4Mb of simultaneous raw IO operations.
92: */
93: #define USRIOSIZE (1 * NPTEPG)
94:
95: /*
96: * PTEs for system V style shared memory.
97: * This is basically slop for kmempt which we actually allocate (malloc) from.
98: */
99: #define SHMMAXPGS 1024
100:
101: /*
102: * Boundary at which to place first MAPMEM segment if not explicitly
103: * specified. Should be a power of two. This allows some slop for
104: * the data segment to grow underneath the first mapped segment.
105: */
106: #define MMSEG 0x200000
107:
108: /*
109: * The size of the clock loop.
110: */
111: #define LOOPPAGES (maxfree - firstfree)
112:
113: /*
114: * The time for a process to be blocked before being very swappable.
115: * This is a number of seconds which the system takes as being a non-trivial
116: * amount of real time. You probably shouldn't change this;
117: * it is used in subtle ways (fractions and multiples of it are, that is, like
118: * half of a ``long time'', almost a long time, etc.)
119: * It is related to human patience and other factors which don't really
120: * change over time.
121: */
122: #define MAXSLP 20
123:
124: /*
125: * A swapped in process is given a small amount of core without being bothered
126: * by the page replacement algorithm. Basically this says that if you are
127: * swapped in you deserve some resources. We protect the last SAFERSS
128: * pages against paging and will just swap you out rather than paging you.
129: * Note that each process has at least UPAGES+CLSIZE pages which are not
130: * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
131: * number just means a swapped in process is given around 25k bytes.
132: * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
133: * so we loan each swapped in process memory worth 100$, or just admit
134: * that we don't consider it worthwhile and swap it out to disk which costs
135: * $30/mb or about $0.75.
136: */
137: #define SAFERSS 4 /* nominal ``small'' resident set size
138: protected against replacement */
139:
140: /*
141: * DISKRPM is used to estimate the number of paging i/o operations
142: * which one can expect from a single disk controller.
143: */
144: #define DISKRPM 60
145:
146: /*
147: * Klustering constants. Klustering is the gathering
148: * of pages together for pagein/pageout, while clustering
149: * is the treatment of hardware page size as though it were
150: * larger than it really is.
151: *
152: * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
153: * units. Note that ctod(KLMAX*CLSIZE) must be <= DMMIN in dmap.h.
154: * ctob(KLMAX) should also be less than MAXPHYS (in vm_swp.c)
155: * unless you like "big push" panics.
156: */
157:
158: #define KLMAX (4/CLSIZE)
159: #define KLSEQL (2/CLSIZE) /* in klust if vadvise(VA_SEQL) */
160: #define KLIN (4/CLSIZE) /* default data/stack in klust */
161: #define KLTXT (4/CLSIZE) /* default text in klust */
162: #define KLOUT (4/CLSIZE)
163:
164: /*
165: * KLSDIST is the advance or retard of the fifo reclaim for sequential
166: * processes data space.
167: */
168: #define KLSDIST 3 /* klusters advance/retard for seq. fifo */
169:
170: /*
171: * Paging thresholds (see vm_sched.c).
172: * Strategy of 1/19/85:
173: * lotsfree is 512k bytes, but at most 1/4 of memory
174: * desfree is 200k bytes, but at most 1/8 of memory
175: * minfree is 64k bytes, but at most 1/2 of desfree
176: */
177: #define LOTSFREE (512 * 1024)
178: #define LOTSFREEFRACT 4
179: #define DESFREE (200 * 1024)
180: #define DESFREEFRACT 8
181: #define MINFREE (64 * 1024)
182: #define MINFREEFRACT 2
183:
184: /*
185: * There are two clock hands, initially separated by HANDSPREAD bytes
186: * (but at most all of user memory). The amount of time to reclaim
187: * a page once the pageout process examines it increases with this
188: * distance and decreases as the scan rate rises.
189: */
190: #define HANDSPREAD (2 * 1024 * 1024)
191:
192: /*
193: * The number of times per second to recompute the desired paging rate
194: * and poke the pagedaemon.
195: */
196: #define RATETOSCHEDPAGING 4
197:
198: /*
199: * Believed threshold (in megabytes) for which interleaved
200: * swapping area is desirable.
201: */
202: #define LOTSOFMEM 2
203:
204: #define mapin(pte, v, pfnum, prot) \
205: (*(u_int *)(pte) = ((pfnum) << PGSHIFT) | (prot), TBIS((caddr_t)(v)))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.