xref: /csrg-svn/sys/vax/include/vmparam.h (revision 29202)
123280Smckusick /*
2*29202Smckusick  * Copyright (c) 1982, 1986 Regents of the University of California.
323280Smckusick  * All rights reserved.  The Berkeley software License Agreement
423280Smckusick  * specifies the terms and conditions for redistribution.
523280Smckusick  *
6*29202Smckusick  *	@(#)vmparam.h	7.1 (Berkeley) 06/05/86
723280Smckusick  */
89119Ssam 
99119Ssam /*
109119Ssam  * Machine dependent constants for VAX
119119Ssam  */
129119Ssam /*
139119Ssam  * USRTEXT is the start of the user text/data space, while USRSTACK
149119Ssam  * is the top (end) of the user stack.  LOWPAGES and HIGHPAGES are
159119Ssam  * the number of pages from the beginning of the P0 region to the
169119Ssam  * beginning of the text and from the beginning of the P1 region to the
179119Ssam  * beginning of the stack respectively.
189119Ssam  */
199119Ssam #define	USRTEXT		0
2016923Smckusick #define	USRSTACK	(0x80000000-UPAGES*NBPG) /* Start of user stack */
2116923Smckusick #define	BTOPUSRSTACK	(0x400000 - UPAGES)	 /* btop(USRSTACK) */
2216923Smckusick /* number of ptes per page */
239119Ssam #define	P1PAGES		0x200000	/* number of pages in P1 region */
249119Ssam #define	LOWPAGES	0
259119Ssam #define	HIGHPAGES	UPAGES
269119Ssam 
279119Ssam /*
2825259Skarels  * Virtual memory related constants, all in bytes
299119Ssam  */
3025259Skarels #ifndef MAXTSIZ
3125259Skarels #define	MAXTSIZ		(6*1024*1024)		/* max text size */
3225259Skarels #endif
3318271Skarels #ifndef DFLDSIZ
3425259Skarels #define	DFLDSIZ		(6*1024*1024)		/* initial data size limit */
3518271Skarels #endif
369119Ssam #ifndef MAXDSIZ
3725259Skarels #define	MAXDSIZ		(16*1024*1024)		/* max data size */
389119Ssam #endif
3918271Skarels #ifndef	DFLSSIZ
4025259Skarels #define	DFLSSIZ		(512*1024)		/* initial stack size limit */
4118271Skarels #endif
4218271Skarels #ifndef	MAXSSIZ
4318271Skarels #define	MAXSSIZ		MAXDSIZ			/* max stack size */
4418271Skarels #endif
459119Ssam 
469119Ssam /*
4718271Skarels  * Default sizes of swap allocation chunks (see dmap.h).
4818271Skarels  * The actual values may be changed in vminit() based on MAXDSIZ.
4918271Skarels  * With MAXDSIZ of 16Mb and NDMAP of 38, dmmax will be 1024.
5018271Skarels  */
5118271Skarels #define	DMMIN	32			/* smallest swap allocation */
5218271Skarels #define	DMMAX	4096			/* largest potential swap allocation */
5318271Skarels #define	DMTEXT	1024			/* swap allocation for text */
5418271Skarels 
5518271Skarels /*
569119Ssam  * Sizes of the system and user portions of the system page table.
579119Ssam  */
589119Ssam /* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
5913445Sroot #define	SYSPTSIZE	((20+MAXUSERS)*NPTEPG)
6018271Skarels #define	USRPTSIZE 	(32*NPTEPG)
619119Ssam 
629119Ssam /*
639119Ssam  * The size of the clock loop.
649119Ssam  */
659119Ssam #define	LOOPPAGES	(maxfree - firstfree)
669119Ssam 
679119Ssam /*
689119Ssam  * The time for a process to be blocked before being very swappable.
699119Ssam  * This is a number of seconds which the system takes as being a non-trivial
709119Ssam  * amount of real time.  You probably shouldn't change this;
719119Ssam  * it is used in subtle ways (fractions and multiples of it are, that is, like
729119Ssam  * half of a ``long time'', almost a long time, etc.)
739119Ssam  * It is related to human patience and other factors which don't really
749119Ssam  * change over time.
759119Ssam  */
769119Ssam #define	MAXSLP 		20
779119Ssam 
789119Ssam /*
799119Ssam  * A swapped in process is given a small amount of core without being bothered
809119Ssam  * by the page replacement algorithm.  Basically this says that if you are
819119Ssam  * swapped in you deserve some resources.  We protect the last SAFERSS
829119Ssam  * pages against paging and will just swap you out rather than paging you.
839119Ssam  * Note that each process has at least UPAGES+CLSIZE pages which are not
849119Ssam  * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
859119Ssam  * number just means a swapped in process is given around 25k bytes.
869119Ssam  * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
879119Ssam  * so we loan each swapped in process memory worth 100$, or just admit
889119Ssam  * that we don't consider it worthwhile and swap it out to disk which costs
899119Ssam  * $30/mb or about $0.75.
909119Ssam  */
919119Ssam #define	SAFERSS		32		/* nominal ``small'' resident set size
929119Ssam 					   protected against replacement */
939119Ssam 
949119Ssam /*
959119Ssam  * DISKRPM is used to estimate the number of paging i/o operations
969119Ssam  * which one can expect from a single disk controller.
979119Ssam  */
989119Ssam #define	DISKRPM		60
999119Ssam 
1009119Ssam /*
1019119Ssam  * Klustering constants.  Klustering is the gathering
1029119Ssam  * of pages together for pagein/pageout, while clustering
1039119Ssam  * is the treatment of hardware page size as though it were
1049119Ssam  * larger than it really is.
1059119Ssam  *
1069119Ssam  * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
1079119Ssam  * units.  Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h.
1089119Ssam  */
1099119Ssam 
1109119Ssam #define	KLMAX	(32/CLSIZE)
1119119Ssam #define	KLSEQL	(16/CLSIZE)		/* in klust if vadvise(VA_SEQL) */
1129119Ssam #define	KLIN	(8/CLSIZE)		/* default data/stack in klust */
1139119Ssam #define	KLTXT	(4/CLSIZE)		/* default text in klust */
1149119Ssam #define	KLOUT	(32/CLSIZE)
1159119Ssam 
1169119Ssam /*
1179119Ssam  * KLSDIST is the advance or retard of the fifo reclaim for sequential
1189119Ssam  * processes data space.
1199119Ssam  */
1209119Ssam #define	KLSDIST	3		/* klusters advance/retard for seq. fifo */
12113122Ssam 
12213122Ssam /*
12313122Ssam  * Paging thresholds (see vm_sched.c).
12418264Smckusick  * Strategy of 1/19/85:
12518264Smckusick  *	lotsfree is 512k bytes, but at most 1/4 of memory
12613122Ssam  *	desfree is 200k bytes, but at most 1/8 of memory
12713122Ssam  *	minfree is 64k bytes, but at most 1/2 of desfree
12813122Ssam  */
12918264Smckusick #define	LOTSFREE	(512 * 1024)
13013122Ssam #define	LOTSFREEFRACT	4
13113122Ssam #define	DESFREE		(200 * 1024)
13213122Ssam #define	DESFREEFRACT	8
13313122Ssam #define	MINFREE		(64 * 1024)
13413122Ssam #define	MINFREEFRACT	2
13513122Ssam 
13613122Ssam /*
13718265Smckusick  * There are two clock hands, initially separated by HANDSPREAD bytes
13818265Smckusick  * (but at most all of user memory).  The amount of time to reclaim
13918265Smckusick  * a page once the pageout process examines it increases with this
14018265Smckusick  * distance and decreases as the scan rate rises.
14118265Smckusick  */
14218265Smckusick #define	HANDSPREAD	(2 * 1024 * 1024)
14318265Smckusick 
14418265Smckusick /*
14518265Smckusick  * The number of times per second to recompute the desired paging rate
14618265Smckusick  * and poke the pagedaemon.
14718265Smckusick  */
14818265Smckusick #define	RATETOSCHEDPAGING	4
14918265Smckusick 
15018265Smckusick /*
15113122Ssam  * Believed threshold (in megabytes) for which interleaved
15213122Ssam  * swapping area is desirable.
15313122Ssam  */
15413122Ssam #define	LOTSOFMEM	2
15513126Ssam 
15613126Ssam /*
15713126Ssam  * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1
15813126Ssam  */
15913126Ssam #define	mapin(pte, v, pfnum, count, prot) \
16013126Ssam 	(*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))
161