maxtsize now in bytes
[unix-history] / usr / src / sys / vax / include / vmparam.h
CommitLineData
da7c5cc6
KM
1/*
2 * Copyright (c) 1982 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
6 * @(#)vmparam.h 6.6 (Berkeley) %G%
7 */
f9390752
SL
8
9/*
10 * Machine dependent constants for VAX
11 */
12/*
13 * USRTEXT is the start of the user text/data space, while USRSTACK
14 * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are
15 * the number of pages from the beginning of the P0 region to the
16 * beginning of the text and from the beginning of the P1 region to the
17 * beginning of the stack respectively.
18 */
f9390752 19#define USRTEXT 0
35495388
KM
20#define USRSTACK (0x80000000-UPAGES*NBPG) /* Start of user stack */
21#define BTOPUSRSTACK (0x400000 - UPAGES) /* btop(USRSTACK) */
22/* number of ptes per page */
f9390752
SL
23#define P1PAGES 0x200000 /* number of pages in P1 region */
24#define LOWPAGES 0
25#define HIGHPAGES UPAGES
26
27/*
2605adde 28 * Virtual memory related constants, all in clicks
f9390752 29 */
2605adde
MK
30#define MAXTSIZ (6*CLSIZE*1024) /* max text size */
31#ifndef DFLDSIZ
32#define DFLDSIZ (6*1024*1024/NBPG) /* initial data size limit */
33#endif
f9390752 34#ifndef MAXDSIZ
2605adde
MK
35#define MAXDSIZ (16*1024*1024/NBPG) /* max data size */
36#endif
37#ifndef DFLSSIZ
38#define DFLSSIZ (512*1024/NBPG) /* initial stack size limit */
39#endif
40#ifndef MAXSSIZ
41#define MAXSSIZ MAXDSIZ /* max stack size */
f9390752 42#endif
2605adde
MK
43
44/*
45 * Default sizes of swap allocation chunks (see dmap.h).
46 * The actual values may be changed in vminit() based on MAXDSIZ.
47 * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
48 */
49#define DMMIN 32 /* smallest swap allocation */
50#define DMMAX 4096 /* largest potential swap allocation */
51#define DMTEXT 1024 /* swap allocation for text */
f9390752
SL
52
53/*
54 * Sizes of the system and user portions of the system page table.
55 */
56/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
57be5610 57#define SYSPTSIZE ((20+MAXUSERS)*NPTEPG)
2605adde 58#define USRPTSIZE (32*NPTEPG)
f9390752
SL
59
60/*
61 * The size of the clock loop.
62 */
63#define LOOPPAGES (maxfree - firstfree)
64
65/*
66 * The time for a process to be blocked before being very swappable.
67 * This is a number of seconds which the system takes as being a non-trivial
68 * amount of real time. You probably shouldn't change this;
69 * it is used in subtle ways (fractions and multiples of it are, that is, like
70 * half of a ``long time'', almost a long time, etc.)
71 * It is related to human patience and other factors which don't really
72 * change over time.
73 */
74#define MAXSLP 20
75
76/*
77 * A swapped in process is given a small amount of core without being bothered
78 * by the page replacement algorithm. Basically this says that if you are
79 * swapped in you deserve some resources. We protect the last SAFERSS
80 * pages against paging and will just swap you out rather than paging you.
81 * Note that each process has at least UPAGES+CLSIZE pages which are not
82 * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
83 * number just means a swapped in process is given around 25k bytes.
84 * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
85 * so we loan each swapped in process memory worth 100$, or just admit
86 * that we don't consider it worthwhile and swap it out to disk which costs
87 * $30/mb or about $0.75.
88 */
89#define SAFERSS 32 /* nominal ``small'' resident set size
90 protected against replacement */
91
92/*
93 * DISKRPM is used to estimate the number of paging i/o operations
94 * which one can expect from a single disk controller.
95 */
96#define DISKRPM 60
97
98/*
99 * Klustering constants. Klustering is the gathering
100 * of pages together for pagein/pageout, while clustering
101 * is the treatment of hardware page size as though it were
102 * larger than it really is.
103 *
104 * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
105 * units. Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h.
106 */
107
108#define KLMAX (32/CLSIZE)
109#define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */
110#define KLIN (8/CLSIZE) /* default data/stack in klust */
111#define KLTXT (4/CLSIZE) /* default text in klust */
112#define KLOUT (32/CLSIZE)
113
114/*
115 * KLSDIST is the advance or retard of the fifo reclaim for sequential
116 * processes data space.
117 */
118#define KLSDIST 3 /* klusters advance/retard for seq. fifo */
299bcbab
SL
119
120/*
121 * Paging thresholds (see vm_sched.c).
a5ab28fa
KM
122 * Strategy of 1/19/85:
123 * lotsfree is 512k bytes, but at most 1/4 of memory
299bcbab
SL
124 * desfree is 200k bytes, but at most 1/8 of memory
125 * minfree is 64k bytes, but at most 1/2 of desfree
126 */
a5ab28fa 127#define LOTSFREE (512 * 1024)
299bcbab
SL
128#define LOTSFREEFRACT 4
129#define DESFREE (200 * 1024)
130#define DESFREEFRACT 8
131#define MINFREE (64 * 1024)
132#define MINFREEFRACT 2
133
00c24382
KM
134/*
135 * There are two clock hands, initially separated by HANDSPREAD bytes
136 * (but at most all of user memory). The amount of time to reclaim
137 * a page once the pageout process examines it increases with this
138 * distance and decreases as the scan rate rises.
139 */
140#define HANDSPREAD (2 * 1024 * 1024)
141
142/*
143 * The number of times per second to recompute the desired paging rate
144 * and poke the pagedaemon.
145 */
146#define RATETOSCHEDPAGING 4
147
299bcbab
SL
148/*
149 * Believed threshold (in megabytes) for which interleaved
150 * swapping area is desirable.
151 */
152#define LOTSOFMEM 2
5862de34
SL
153
154/*
155 * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1
156 */
157#define mapin(pte, v, pfnum, count, prot) \
158 (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))