xref: /csrg-svn/sys/vax/include/vmparam.h (revision 18265)
1*18265Smckusick /*	vmparam.h	6.4	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 /*
229119Ssam  * Virtual memory related constants
239119Ssam  */
249119Ssam #define	SLOP	32
259119Ssam #define	MAXTSIZ		(6*2048-SLOP)		/* max text size (clicks) */
269119Ssam #ifndef MAXDSIZ
279119Ssam #define	MAXDSIZ		(12*1024-32-SLOP)	/* max data size (clicks) */
289119Ssam #endif
299119Ssam #define	MAXSSIZ		(12*1024-32-SLOP)	/* max stack size (clicks) */
309119Ssam 
319119Ssam /*
329119Ssam  * Sizes of the system and user portions of the system page table.
339119Ssam  */
349119Ssam /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
3513445Sroot #define	SYSPTSIZE	((20+MAXUSERS)*NPTEPG)
369119Ssam #define	USRPTSIZE 	(8*NPTEPG)
379119Ssam 
389119Ssam /*
399119Ssam  * The size of the clock loop.
409119Ssam  */
419119Ssam #define	LOOPPAGES	(maxfree - firstfree)
429119Ssam 
439119Ssam /*
449119Ssam  * The time for a process to be blocked before being very swappable.
459119Ssam  * This is a number of seconds which the system takes as being a non-trivial
469119Ssam  * amount of real time.  You probably shouldn't change this;
479119Ssam  * it is used in subtle ways (fractions and multiples of it are, that is, like
489119Ssam  * half of a ``long time'', almost a long time, etc.)
499119Ssam  * It is related to human patience and other factors which don't really
509119Ssam  * change over time.
519119Ssam  */
529119Ssam #define	MAXSLP 		20
539119Ssam 
549119Ssam /*
559119Ssam  * A swapped in process is given a small amount of core without being bothered
569119Ssam  * by the page replacement algorithm.  Basically this says that if you are
579119Ssam  * swapped in you deserve some resources.  We protect the last SAFERSS
589119Ssam  * pages against paging and will just swap you out rather than paging you.
599119Ssam  * Note that each process has at least UPAGES+CLSIZE pages which are not
609119Ssam  * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
619119Ssam  * number just means a swapped in process is given around 25k bytes.
629119Ssam  * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
639119Ssam  * so we loan each swapped in process memory worth 100$, or just admit
649119Ssam  * that we don't consider it worthwhile and swap it out to disk which costs
659119Ssam  * $30/mb or about $0.75.
669119Ssam  */
679119Ssam #define	SAFERSS		32		/* nominal ``small'' resident set size
689119Ssam 					   protected against replacement */
699119Ssam 
709119Ssam /*
719119Ssam  * DISKRPM is used to estimate the number of paging i/o operations
729119Ssam  * which one can expect from a single disk controller.
739119Ssam  */
749119Ssam #define	DISKRPM		60
759119Ssam 
769119Ssam /*
779119Ssam  * Klustering constants.  Klustering is the gathering
789119Ssam  * of pages together for pagein/pageout, while clustering
799119Ssam  * is the treatment of hardware page size as though it were
809119Ssam  * larger than it really is.
819119Ssam  *
829119Ssam  * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
839119Ssam  * units.  Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h.
849119Ssam  */
859119Ssam 
869119Ssam #define	KLMAX	(32/CLSIZE)
879119Ssam #define	KLSEQL	(16/CLSIZE)		/* in klust if vadvise(VA_SEQL) */
889119Ssam #define	KLIN	(8/CLSIZE)		/* default data/stack in klust */
899119Ssam #define	KLTXT	(4/CLSIZE)		/* default text in klust */
909119Ssam #define	KLOUT	(32/CLSIZE)
919119Ssam 
929119Ssam /*
939119Ssam  * KLSDIST is the advance or retard of the fifo reclaim for sequential
949119Ssam  * processes data space.
959119Ssam  */
969119Ssam #define	KLSDIST	3		/* klusters advance/retard for seq. fifo */
9713122Ssam 
9813122Ssam /*
9913122Ssam  * Paging thresholds (see vm_sched.c).
10018264Smckusick  * Strategy of 1/19/85:
10118264Smckusick  *	lotsfree is 512k bytes, but at most 1/4 of memory
10213122Ssam  *	desfree is 200k bytes, but at most 1/8 of memory
10313122Ssam  *	minfree is 64k bytes, but at most 1/2 of desfree
10413122Ssam  */
10518264Smckusick #define	LOTSFREE	(512 * 1024)
10613122Ssam #define	LOTSFREEFRACT	4
10713122Ssam #define	DESFREE		(200 * 1024)
10813122Ssam #define	DESFREEFRACT	8
10913122Ssam #define	MINFREE		(64 * 1024)
11013122Ssam #define	MINFREEFRACT	2
11113122Ssam 
11213122Ssam /*
113*18265Smckusick  * There are two clock hands, initially separated by HANDSPREAD bytes
114*18265Smckusick  * (but at most all of user memory).  The amount of time to reclaim
115*18265Smckusick  * a page once the pageout process examines it increases with this
116*18265Smckusick  * distance and decreases as the scan rate rises.
117*18265Smckusick  */
118*18265Smckusick #define	HANDSPREAD	(2 * 1024 * 1024)
119*18265Smckusick 
120*18265Smckusick /*
121*18265Smckusick  * The number of times per second to recompute the desired paging rate
122*18265Smckusick  * and poke the pagedaemon.
123*18265Smckusick  */
124*18265Smckusick #define	RATETOSCHEDPAGING	4
125*18265Smckusick 
126*18265Smckusick /*
12713122Ssam  * Believed threshold (in megabytes) for which interleaved
12813122Ssam  * swapping area is desirable.
12913122Ssam  */
13013122Ssam #define	LOTSOFMEM	2
13113126Ssam 
13213126Ssam /*
13313126Ssam  * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1
13413126Ssam  */
13513126Ssam #define	mapin(pte, v, pfnum, count, prot) \
13613126Ssam 	(*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))
137