Commit Graph

22 Commits

Author SHA1 Message Date
Poul-Henning Kamp
aa8de40ae5 Another sweep over the pmap/vm macros, this time with more focus on
the usage.  I'm not satisfied with the naming, but now at least there is
less bogus stuff around.
1996-05-03 21:01:54 +00:00
Poul-Henning Kamp
5084d10dd0 Move atdevbase out of locore.s and into machdep.c
Macroize locore.s' page table setup even more, now it's almost readable.
Rename PG_U to PG_A (so that I can...)
Rename PG_u to PG_U.  "PG_u" was just too ugly...
Remove some unused vars in pmap.c
Remove PG_KR and PG_KW
Remove SSIZE
Remove SINCR
Remove BTOPKERNBASE

This concludes my spring cleaning, modulus any bug fixes for messes I
have made on the way.

(Funny to be back here in pmap.c, that's where my first significant
contribution to 386BSD was... :-)
1996-05-02 22:25:18 +00:00
Poul-Henning Kamp
e911eafcba removed:
CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei()
        ptei() kvtopte() ptetov() ispt() ptetoav() &c &c
new:
        NPDEPG

Major macro cleanup.
1996-05-02 14:21:14 +00:00
David Greenman
b64b660cd3 Made "NMBCLUSTERS" calculation dynamic and fixed bogus use of "NMBCLUSTERS"
in machdep.c (it should use the global nmbclusters). Moved the calculation
of nmbclusters into conf/param.c (same place where nmbclusters has always
been assigned), and made the calculation include an extra amount based
on "maxusers". NMBCLUSTERS can still be overrided in the kernel config
file as always, but this change will make that generally unnecessary. This
fixes the "bug" reports from people who have misconfigured kernels seeing
the network hang when the mbuf cluster pool runs out.

Reviewed by:	John Dyson
1995-05-25 07:41:28 +00:00
Gary Palmer
43decb5384 Bruces fixes for large filesystems
Submitted by:	Bruce Evans <bde@zeta.org.au>
1995-02-19 10:36:17 +00:00
David Greenman
fb1322e408 Decrease MCLBYTES from 4k back to 2k. It isn't likely that we'll be doing
page flipping anytime soon and 4k just wastes memory. Performance via the
looback interface will decrease slightly by this change. Idealy, we need
buffers that can have variable sizes, but this requires a rewrite of far
too much code at the moment.
1995-01-23 19:21:49 +00:00
Bruce Evans
6052572ac4 Replace unsigned' by u_int' so that it is not necessary to include
<sys/types.h> before including this header.  This header is now
idempotent.

Uniformize idempotency #ifdef.
1994-09-18 22:05:22 +00:00
Rodney W. Grimes
26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
David Greenman
04f1835605 1) "Pre-faulting" in of pages into process address space
Eliminates vm_fault overhead on process startup and
		mmap referenced data for in-memory pages.

		(process startup time using in-memory segments *much* faster)

	2)	Even more efficient pmap code.  Code partially cleaned up.
		More comments yet to follow.

		(generally more efficient pte management)

	3)	Pageout clustering ( in addition to the FreeBSD V1.1 pagein
		clustering.)

		(much faster paging performance on non-write behind disk
		subsystems, slightly faster performance on other systems.)

	4)	Slightly changed vm_pageout code for more efficiency and
		better statistics.  Also, resist swapout a little more.

		(less likely to pageout a recently used page)

	5)	Slight improvement to the page table page trap efficiency.

		(generally faster system VM fault performance)

	6)	Defer creation of unnamed anonymous regions pager until needed.

		(speeds up shared memory bss creation)

	7)	Remove possible deadlock from swap_pager initialization.

	8)	Enhanced procfs to provide "vminfo" about vm objects and user
		pmaps.

	9)	Increased MCLSHIFT/MCLBYTES from 2K to 4K to improve net &
		socket performance and to prepare for things to come.

John Dyson
dyson@implode.root.com
David Greenman
davidg@root.com
1994-03-07 11:38:49 +00:00
David Greenman
ec120393a0 VM system performance improvements from John Dyson and myself. The
following is a summary:

1) increased object cache back up to a more reasonable value.
2) removed old & bogus cruft from machdep.c (clearseg, copyseg,
	physcopyseg, etc).
3) inlined many functions in pmap.c
4) changed "load_cr3(rcr3())" into tlbflush() and made tlbflush inline
	assembly.
5) changed the way that modified pages are tracked - now vm_page struct
	is kept updated directly - no more scanning page tables.
6) removed lots of unnecessary spl's
7) removed old unused functions from pmap.c
8) removed all use of page_size, page_shift, page_mask variables - replaced
	with PAGE_ constants.
9) moved trunc/round_page, atop, ptoa, out of vm_param.h and into i386/
	include/param.h, and optimized them.
10) numerous changes to sys/vm/ swap_pager, vnode_pager, pageout, fault
	code to improve performance. LRU algorithm modified to be more
	effective, read ahead/behind values tuned for better performance,
	etc, etc...
1994-01-31 04:19:00 +00:00
David Greenman
7f8cb36869 "New" VM system from John Dyson & myself. For a run-down of the
major changes, see the log of any effected file in the sys/vm
directory (swap_pager.c for instance).
1994-01-14 16:25:31 +00:00
Garrett Wollman
aaf08d94ca Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit.  Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.

NB: -Wtraditional will henceforth be forgotten.  This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax.  These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.
1993-12-19 00:55:01 +00:00
Rodney W. Grimes
57bb0ee45f New version of scsi code from Julian 1993-11-18 05:03:27 +00:00
David Greenman
0967373e1c First steps in rewriting locore.s, and making info useful
when the machine panics.

i386/i386/locore.s:
1) got rid of most .set directives that were being used like
	#define's, and replaced them with appropriate #define's in
	the appropriate header files (accessed via genassym).
2) added comments to header inclusions and global definitions,
	and global variables
3) replaced some hardcoded constants with cpp defines (such as
	PDESIZE and others)
4) aligned all comments to the same column to make them easier to
	read
5) moved macro definitions for ENTRY, ALIGN, NOP, etc. to
	/sys/i386/include/asmacros.h
6) added #ifdef BDE_DEBUGGER around all of Bruce's debugger code
7) added new global '_KERNend' to store last location+1 of kernel
8) cleaned up zeroing of bss so that only bss is zeroed
9) fix zeroing of page tables so that it really does zero them all
	- not just if they follow the bss.
10) rewrote page table initialization code so that 1) works correctly
	and 2) write protects the kernel text by default
11) properly initialize the kernel page directory, upages, p0stack PT,
	and page tables. The previous scheme was more than a bit
	screwy.
12) change allocation of virtual area of IO hole so that it is
	fixed at KERNBASE + 0xa0000. The previous scheme put it
	right after the kernel page tables and then later expected
	it to be at KERNBASE +0xa0000
13) change multiple bogus settings of user read/write of various
	areas of kernel VM - including the IO hole; we should never
	be accessing the IO hole in user mode through the kernel
	page tables
14) split kernel support routines such as bcopy, bzero, copyin,
	copyout, etc. into a seperate file 'support.s'
15) split swtch and related routines into a seperate 'swtch.s'
16) split routines related to traps, syscalls, and interrupts
	into a seperate file 'exception.s'
17) remove some unused global variables from locore that got
	inserted by Garrett when he pulled them out of some .h
	files.

i386/isa/icu.s:
1) clean up global variable declarations
2) move in declaration of astpending and netisr

i386/i386/pmap.c:
1) fix calculation of virtual_avail. It previously was calculated
	to be right in the middle of the kernel page tables - not
	a good place to start allocating kernel VM.
2) properly allocate kernel page dir/tables etc out of kernel map
	- previously only took out 2 pages.

i386/i386/machdep.c:
1) modify boot() to print a warning that the system will reboot in
	PANIC_REBOOT_WAIT_TIME amount of seconds, and let the user
	abort with a key on the console. The machine will wait for
	ever if a key is typed before the reboot. The default is
	15 seconds, but can be set to 0 to mean don't wait at all,
	-1 to mean wait forever, or any positive value to wait for
	that many seconds.
2) print "Rebooting..." just before doing it.

kern/subr_prf.c:
1) remove PANICWAIT as it is deprecated by the change to machdep.c

i386/i386/trap.c:
1) add table of trap type strings and use it to print a real trap/
	panic message rather than just a number. Lot's of work to
	be done here, but this is the first step. Symbolic traceback
	is in the TODO.

i386/i386/Makefile.i386:
1) add support in to build support.s, exception.s and swtch.s

...and various changes to various header files to make all of the
	above happen.
1993-11-13 02:25:21 +00:00
Garrett Wollman
6e393973f5 Made all header files idempotent and moved incorrect common data from
headers into a related source file.  Added cons.h as first step towards
moving i386/i386/cons.h to machine/cons.h where it belongs.
1993-11-07 17:43:17 +00:00
Rodney W. Grimes
d42d25c451 param.h:
Mark the fact that PGSHIFT and PDRSHIFT are really the same as
PG_SHIFT and PD_SHIFT, these should be collapsed some day soon.

Document that KERNBASE should really be KPTDPTDI << PDRSHIFT, for
now leave it as the constant 0xFE000000 until I make a seperate
common header file for this stuff (vmaddresses.h?)

Remove NKMEMCLUSTERS define, it was only being used to define
VM_KMEM_SIZE, so why have all the indirection.  Besides who wants
to work in CLBYTE sizes chuncks.


pmap.h:

Fix $Id$ and some other minor format clean ups.

Remove the XXX comment about NKPDE, since it now has the correct value
of 7.

Remove unused LASTPTDI and move the APTD into the very end of memory to
free up 4MB of kernel virtual address space.
Remove unused RSVDPTDI and free up 12MB of kernel virtual address space.


vmparam.h

Fix $Id$.

Increase SHMMAXPGS to 512 (2MB) now that there is room for it to be
bigger.  The XXX comment stays until the kernel moves down in memory
to free up enough space to use the proper default of 4MB.

VM_KMEM_SIZE is now a direct constant stating the size of the kernel
malloc region.  Increased the value from 3MB to 16MB.
1993-10-15 10:07:45 +00:00
Rodney W. Grimes
da73bf46a5 Fixed PHYSTOKV, addition operator on pointers is the wrong thing to do
here.  This is really a crock, but it works.
1993-10-12 12:08:16 +00:00
Rodney W. Grimes
d529c3d85c Add PHYSTOKV used in scsi drivers with a correct definition based on
KERNBASE.

Change #define<tab> to #define<space> on lines that had it wrong
1993-10-12 07:13:12 +00:00
Rodney W. Grimes
c77ba36045 Fix definitions to be in terms of a minimum number of constants by
using the SHIFT value as the basis for the other values, for example
instead of:
#define		NBPG		4096
#define		PGSHIFT		12
use:
#define		PGSHIFT		12
#define		NBPG		(1 << PGSHIFT)

===================================================================
RCS file: /a/cvs/386BSD/src/sys/i386/include/param.h,v
retrieving revision 1.3
diff -c -r1.3 param.h
*** 1.3	1993/10/08 12:49:55
--- param.h	1993/10/08 12:53:19
***************
*** 52,76 ****
  #define ALIGNBYTES	(sizeof(int) - 1)
  #define ALIGN(p)	(((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)

- #define	NBPG		4096		/* bytes/page */
- #define	PGOFSET		(NBPG-1)	/* byte offset into page */
  #define	PGSHIFT		12		/* LOG2(NBPG) */
  #define	NPTEPG		(NBPG/(sizeof (struct pte)))

- #define NBPDR		(1024*NBPG)	/* bytes/page dir */
- #define	PDROFSET	(NBPDR-1)	/* byte offset into page dir */
  #define	PDRSHIFT	22		/* LOG2(NBPDR) */

  #define	KERNBASE	0xFE000000	/* start of kernel virtual */
  #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)

! #define	DEV_BSIZE	512
  #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
  #define BLKDEV_IOSIZE	2048
  #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */

- #define	CLSIZE		1
  #define	CLSIZELOG2	0

  /* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
  #define	SSIZE	1		/* initial stack size/NBPG */
--- 52,79 ----
  #define ALIGNBYTES	(sizeof(int) - 1)
  #define ALIGN(p)	(((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)

  #define	PGSHIFT		12		/* LOG2(NBPG) */
+ #define	NBPG		(1 << PGSHIFT)	/* bytes/page */
+ #define	PGOFSET		(NBPG-1)	/* byte offset into page */
  #define	NPTEPG		(NBPG/(sizeof (struct pte)))

  #define	PDRSHIFT	22		/* LOG2(NBPDR) */
+ #define NBPDR		(1 << PDRSHIFT)	/* bytes/page dir */
+ #define	PDROFSET	(NBPDR-1)	/* byte offset into page dir */

  #define	KERNBASE	0xFE000000	/* start of kernel virtual */
  #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)

! #define	KERNSIZE	0x00C00000	/* size of kernel virtual */
!
  #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
+ #define	DEV_BSIZE	(1 << DEV_BSHIFT)
+
  #define BLKDEV_IOSIZE	2048
  #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */

  #define	CLSIZELOG2	0
+ #define	CLSIZE		(1 << CLSIZELOG2)

  /* NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE */
  #define	SSIZE	1		/* initial stack size/NBPG */
***************
*** 92,99 ****
  #ifndef	MCLSHIFT
  #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
  #endif	/* MCLSHIFT */
! #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
! #define	MCLOFSET	(MCLBYTES - 1)	/* offset within a m_buf cluster */

  #ifndef NMBCLUSTERS
  #ifdef GATEWAY
--- 95,102 ----
  #ifndef	MCLSHIFT
  #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
  #endif	/* MCLSHIFT */
! #define	MCLBYTES	(1 << MCLSHIFT)	/* size of an m_buf cluster */
! #define	MCLOFSET	(MCLBYTES - 1)	/* offset within an m_buf cluster */

  #ifndef NMBCLUSTERS
  #ifdef GATEWAY
1993-10-08 13:01:34 +00:00
Rodney W. Grimes
89ec6ec6bf Removed patch kit header. Cleaned up tabbing and removed extra blank
lines to match NetBSD.  Added $Id$.
Added MID_MACHINE from NetBSD.
Removed definition of DELAY() for non-kernel soures.
Fixed some small english errors that had been corrected in NetBSD.
File is now identical to NetBSD's, but will be changing soon for some
of my clean up work.
1993-10-08 12:49:55 +00:00
Nate Williams
f798d06073 fts(3) integration patches 1993-07-28 01:42:17 +00:00
Rodney W. Grimes
5b81b6b301 Initial import, 0.1 + pk 0.2.4-B1 1993-06-12 14:58:17 +00:00