|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1988 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 7.2 (Berkeley) 5/10/90 ! 7: */ ! 8: ! 9: /* ! 10: * Machine dependent constants for tahoe. ! 11: */ ! 12: ! 13: /* ! 14: * USRTEXT is the start of the user text/data space, while USRSTACK ! 15: * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are ! 16: * the number of pages from the beginning of the P0 region to the ! 17: * beginning of the text and from the beginning of the P2 region to the ! 18: * beginning of the stack respectively. ! 19: */ ! 20: #define USRTEXT 0 ! 21: #define USRSTACK (0xc0000000-UPAGES*NBPG) /* Start of user stack */ ! 22: #define BTOPUSRSTACK (0x300000 - UPAGES) /* btop(USRSTACK) */ ! 23: #define P2PAGES 0x100000 /* number of pages in P2 region */ ! 24: #define LOWPAGES 0 ! 25: #define HIGHPAGES UPAGES ! 26: ! 27: /* ! 28: * Virtual memory related constants, all in bytes ! 29: */ ! 30: #define MAXTSIZ (6*1024*1024) /* max text size */ ! 31: #ifndef DFLDSIZ ! 32: #define DFLDSIZ (6*1024*1024) /* initial data size limit */ ! 33: #endif ! 34: #ifndef MAXDSIZ ! 35: #define MAXDSIZ (32*1024*1024) /* max data size */ ! 36: #endif ! 37: #ifndef DFLSSIZ ! 38: #define DFLSSIZ (512*1024) /* initial stack size limit */ ! 39: #endif ! 40: #ifndef MAXSSIZ ! 41: #define MAXSSIZ MAXDSIZ /* max stack size */ ! 42: #endif ! 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: * DMMIN should be at least ctod(1) so that vtod() works. ! 49: * vminit() ensures this. ! 50: */ ! 51: #define DMMIN 32 /* smallest swap allocation */ ! 52: #define DMMAX 4096 /* largest potential swap allocation */ ! 53: #define DMTEXT 1024 /* swap allocation for text */ ! 54: ! 55: /* ! 56: * Sizes of the system and user portions of the system page table. ! 57: */ ! 58: /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ ! 59: #define SYSPTSIZE ((20+MAXUSERS/2)*NPTEPG) ! 60: #define USRPTSIZE (4*NPTEPG) ! 61: ! 62: /* ! 63: * PTEs for system V compatible shared memory. ! 64: * This is basically slop for kmempt which we actually allocate (malloc) from. ! 65: */ ! 66: #define SHMMAXPGS 512 ! 67: ! 68: /* ! 69: * Boundary at which to place first MAPMEM segment if not explicitly ! 70: * specified. Should be a power of two. This allows some slop for ! 71: * the data segment to grow underneath the first mapped segment. ! 72: */ ! 73: #define MMSEG 0x200000 ! 74: ! 75: /* ! 76: * The size of the clock loop. ! 77: */ ! 78: #define LOOPPAGES (maxfree - firstfree) ! 79: ! 80: /* ! 81: * The time for a process to be blocked before being very swappable. ! 82: * This is a number of seconds which the system takes as being a non-trivial ! 83: * amount of real time. You probably shouldn't change this; ! 84: * it is used in subtle ways (fractions and multiples of it are, that is, like ! 85: * half of a ``long time'', almost a long time, etc.) ! 86: * It is related to human patience and other factors which don't really ! 87: * change over time. ! 88: */ ! 89: #define MAXSLP 20 ! 90: ! 91: /* ! 92: * A swapped in process is given a small amount of core without being bothered ! 93: * by the page replacement algorithm. Basically this says that if you are ! 94: * swapped in you deserve some resources. We protect the last SAFERSS ! 95: * pages against paging and will just swap you out rather than paging you. ! 96: * Note that each process has at least UPAGES+CLSIZE pages which are not ! 97: * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this ! 98: * number just means a swapped in process is given around 25k bytes. ! 99: * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), ! 100: * so we loan each swapped in process memory worth 100$, or just admit ! 101: * that we don't consider it worthwhile and swap it out to disk which costs ! 102: * $30/mb or about $0.75. ! 103: */ ! 104: #define SAFERSS 32 /* nominal ``small'' resident set size ! 105: protected against replacement */ ! 106: ! 107: /* ! 108: * DISKRPM is used to estimate the number of paging i/o operations ! 109: * which one can expect from a single disk controller. ! 110: */ ! 111: #define DISKRPM 60 ! 112: ! 113: /* ! 114: * Klustering constants. Klustering is the gathering ! 115: * of pages together for pagein/pageout, while clustering ! 116: * is the treatment of hardware page size as though it were ! 117: * larger than it really is. ! 118: * ! 119: * KLMAX gives maximum cluster size in CLSIZE page (cluster-page) ! 120: * units. Note that ctod(KLMAX*CLSIZE) must be <= DMMIN in dmap.h. ! 121: * ctob(KLMAX) should also be less than MAXPHYS (in vm_swp.c) to ! 122: * avoid "big push" panics. ! 123: */ ! 124: ! 125: #define KLMAX (32/CLSIZE) ! 126: #define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */ ! 127: #define KLIN (8/CLSIZE) /* default data/stack in klust */ ! 128: #define KLTXT (4/CLSIZE) /* default text in klust */ ! 129: #define KLOUT (32/CLSIZE) ! 130: ! 131: /* ! 132: * KLSDIST is the advance or retard of the fifo reclaim for sequential ! 133: * processes data space. ! 134: */ ! 135: #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ ! 136: ! 137: /* ! 138: * Paging thresholds (see vm_sched.c). ! 139: * Strategy of 1/19/85: ! 140: * lotsfree is 512k bytes, but at most 1/4 of memory ! 141: * desfree is 200k bytes, but at most 1/8 of memory ! 142: * minfree is 64k bytes, but at most 1/2 of desfree ! 143: */ ! 144: #define LOTSFREE (512 * 1024) ! 145: #define LOTSFREEFRACT 4 ! 146: #define DESFREE (200 * 1024) ! 147: #define DESFREEFRACT 8 ! 148: #define MINFREE (64 * 1024) ! 149: #define MINFREEFRACT 2 ! 150: ! 151: /* ! 152: * There are two clock hands, initially separated by HANDSPREAD bytes ! 153: * (but at most all of user memory). The amount of time to reclaim ! 154: * a page once the pageout process examines it increases with this ! 155: * distance and decreases as the scan rate rises. ! 156: */ ! 157: #define HANDSPREAD (2 * 1024 * 1024) ! 158: ! 159: /* ! 160: * The number of times per second to recompute the desired paging rate ! 161: * and poke the pagedaemon. ! 162: */ ! 163: #define RATETOSCHEDPAGING 4 ! 164: ! 165: /* ! 166: * Believed threshold (in megabytes) for which interleaved ! 167: * swapping area is desirable. ! 168: */ ! 169: #define LOTSOFMEM 2 ! 170: ! 171: #define mapin(pte, v, pfnum, prot) \ ! 172: (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, v)) ! 173: ! 174: /* ! 175: * Invalidate a cluster (optimized here for standard CLSIZE). ! 176: */ ! 177: #if CLSIZE == 1 ! 178: #define tbiscl(v) mtpr(TBIS, ptob(v)) ! 179: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.