1*18271Skarels /* vmparam.h 6.5 85/03/07 */ 29119Ssam 39119Ssam /* 49119Ssam * Machine dependent constants for VAX 59119Ssam */ 69119Ssam /* 79119Ssam * USRTEXT is the start of the user text/data space, while USRSTACK 89119Ssam * is the top (end) of the user stack. LOWPAGES and HIGHPAGES are 99119Ssam * the number of pages from the beginning of the P0 region to the 109119Ssam * beginning of the text and from the beginning of the P1 region to the 119119Ssam * beginning of the stack respectively. 129119Ssam */ 139119Ssam #define USRTEXT 0 1416923Smckusick #define USRSTACK (0x80000000-UPAGES*NBPG) /* Start of user stack */ 1516923Smckusick #define BTOPUSRSTACK (0x400000 - UPAGES) /* btop(USRSTACK) */ 1616923Smckusick /* number of ptes per page */ 179119Ssam #define P1PAGES 0x200000 /* number of pages in P1 region */ 189119Ssam #define LOWPAGES 0 199119Ssam #define HIGHPAGES UPAGES 209119Ssam 219119Ssam /* 22*18271Skarels * Virtual memory related constants, all in clicks 239119Ssam */ 24*18271Skarels #define MAXTSIZ (6*CLSIZE*1024) /* max text size */ 25*18271Skarels #ifndef DFLDSIZ 26*18271Skarels #define DFLDSIZ (6*1024*1024/NBPG) /* initial data size limit */ 27*18271Skarels #endif 289119Ssam #ifndef MAXDSIZ 29*18271Skarels #define MAXDSIZ (16*1024*1024/NBPG) /* max data size */ 309119Ssam #endif 31*18271Skarels #ifndef DFLSSIZ 32*18271Skarels #define DFLSSIZ (512*1024/NBPG) /* initial stack size limit */ 33*18271Skarels #endif 34*18271Skarels #ifndef MAXSSIZ 35*18271Skarels #define MAXSSIZ MAXDSIZ /* max stack size */ 36*18271Skarels #endif 379119Ssam 389119Ssam /* 39*18271Skarels * Default sizes of swap allocation chunks (see dmap.h). 40*18271Skarels * The actual values may be changed in vminit() based on MAXDSIZ. 41*18271Skarels * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024. 42*18271Skarels */ 43*18271Skarels #define DMMIN 32 /* smallest swap allocation */ 44*18271Skarels #define DMMAX 4096 /* largest potential swap allocation */ 45*18271Skarels #define DMTEXT 1024 /* swap allocation for text */ 46*18271Skarels 47*18271Skarels /* 489119Ssam * Sizes of the system and user portions of the system page table. 499119Ssam */ 509119Ssam /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */ 5113445Sroot #define SYSPTSIZE ((20+MAXUSERS)*NPTEPG) 52*18271Skarels #define USRPTSIZE (32*NPTEPG) 539119Ssam 549119Ssam /* 559119Ssam * The size of the clock loop. 569119Ssam */ 579119Ssam #define LOOPPAGES (maxfree - firstfree) 589119Ssam 599119Ssam /* 609119Ssam * The time for a process to be blocked before being very swappable. 619119Ssam * This is a number of seconds which the system takes as being a non-trivial 629119Ssam * amount of real time. You probably shouldn't change this; 639119Ssam * it is used in subtle ways (fractions and multiples of it are, that is, like 649119Ssam * half of a ``long time'', almost a long time, etc.) 659119Ssam * It is related to human patience and other factors which don't really 669119Ssam * change over time. 679119Ssam */ 689119Ssam #define MAXSLP 20 699119Ssam 709119Ssam /* 719119Ssam * A swapped in process is given a small amount of core without being bothered 729119Ssam * by the page replacement algorithm. Basically this says that if you are 739119Ssam * swapped in you deserve some resources. We protect the last SAFERSS 749119Ssam * pages against paging and will just swap you out rather than paging you. 759119Ssam * Note that each process has at least UPAGES+CLSIZE pages which are not 769119Ssam * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this 779119Ssam * number just means a swapped in process is given around 25k bytes. 789119Ssam * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81), 799119Ssam * so we loan each swapped in process memory worth 100$, or just admit 809119Ssam * that we don't consider it worthwhile and swap it out to disk which costs 819119Ssam * $30/mb or about $0.75. 829119Ssam */ 839119Ssam #define SAFERSS 32 /* nominal ``small'' resident set size 849119Ssam protected against replacement */ 859119Ssam 869119Ssam /* 879119Ssam * DISKRPM is used to estimate the number of paging i/o operations 889119Ssam * which one can expect from a single disk controller. 899119Ssam */ 909119Ssam #define DISKRPM 60 919119Ssam 929119Ssam /* 939119Ssam * Klustering constants. Klustering is the gathering 949119Ssam * of pages together for pagein/pageout, while clustering 959119Ssam * is the treatment of hardware page size as though it were 969119Ssam * larger than it really is. 979119Ssam * 989119Ssam * KLMAX gives maximum cluster size in CLSIZE page (cluster-page) 999119Ssam * units. Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h. 1009119Ssam */ 1019119Ssam 1029119Ssam #define KLMAX (32/CLSIZE) 1039119Ssam #define KLSEQL (16/CLSIZE) /* in klust if vadvise(VA_SEQL) */ 1049119Ssam #define KLIN (8/CLSIZE) /* default data/stack in klust */ 1059119Ssam #define KLTXT (4/CLSIZE) /* default text in klust */ 1069119Ssam #define KLOUT (32/CLSIZE) 1079119Ssam 1089119Ssam /* 1099119Ssam * KLSDIST is the advance or retard of the fifo reclaim for sequential 1109119Ssam * processes data space. 1119119Ssam */ 1129119Ssam #define KLSDIST 3 /* klusters advance/retard for seq. fifo */ 11313122Ssam 11413122Ssam /* 11513122Ssam * Paging thresholds (see vm_sched.c). 11618264Smckusick * Strategy of 1/19/85: 11718264Smckusick * lotsfree is 512k bytes, but at most 1/4 of memory 11813122Ssam * desfree is 200k bytes, but at most 1/8 of memory 11913122Ssam * minfree is 64k bytes, but at most 1/2 of desfree 12013122Ssam */ 12118264Smckusick #define LOTSFREE (512 * 1024) 12213122Ssam #define LOTSFREEFRACT 4 12313122Ssam #define DESFREE (200 * 1024) 12413122Ssam #define DESFREEFRACT 8 12513122Ssam #define MINFREE (64 * 1024) 12613122Ssam #define MINFREEFRACT 2 12713122Ssam 12813122Ssam /* 12918265Smckusick * There are two clock hands, initially separated by HANDSPREAD bytes 13018265Smckusick * (but at most all of user memory). The amount of time to reclaim 13118265Smckusick * a page once the pageout process examines it increases with this 13218265Smckusick * distance and decreases as the scan rate rises. 13318265Smckusick */ 13418265Smckusick #define HANDSPREAD (2 * 1024 * 1024) 13518265Smckusick 13618265Smckusick /* 13718265Smckusick * The number of times per second to recompute the desired paging rate 13818265Smckusick * and poke the pagedaemon. 13918265Smckusick */ 14018265Smckusick #define RATETOSCHEDPAGING 4 14118265Smckusick 14218265Smckusick /* 14313122Ssam * Believed threshold (in megabytes) for which interleaved 14413122Ssam * swapping area is desirable. 14513122Ssam */ 14613122Ssam #define LOTSOFMEM 2 14713126Ssam 14813126Ssam /* 14913126Ssam * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 15013126Ssam */ 15113126Ssam #define mapin(pte, v, pfnum, count, prot) \ 15213126Ssam (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) 153