Commit Graph

514 Commits

Author SHA1 Message Date
John Dyson
507b10b48c Add exposure of some vm_zone allocation stats by sysctl. Also, change
the initialization parameters of some zones in VM map.  This contains
only optimizations and not bugfixes.
1997-08-06 04:58:05 +00:00
John Dyson
ba9be04c72 Fixed the commit botch that was causing crashes soon after system
startup.  Due to the error, the initialization of the zone for
pv_entries was missing.  The system should be usable again.
1997-08-05 23:03:24 +00:00
John Dyson
0d65e566b9 Another attempt at cleaning up the new memory allocator. 1997-08-05 22:24:31 +00:00
John Dyson
b79933ebfa Fix some bugs, document vm_zone better. Add copyright to vm_zone.h. Use
the new zone code in pmap.c so that we can get rid of the ugly ad-hoc
allocations in pmap.c.
1997-08-05 22:07:27 +00:00
John Dyson
f2adc8bb27 Modify pmap to use our new memory allocator. Also, change the vm_map_entry
allocations to be interrupt safe.
1997-08-05 01:32:52 +00:00
John Dyson
565bca977d A very simple zone allocator. 1997-08-05 00:07:31 +00:00
John Dyson
3075778b63 Get rid of the ad-hoc memory allocator for vm_map_entries, in lieu of
a simple, clean zone type allocator.  This new allocator will also be
used for machine dependent pmap PV entries.
1997-08-05 00:02:08 +00:00
Bruce Evans
1fd0b0588f Removed unused #includes. 1997-08-02 14:33:27 +00:00
John Dyson
dc2efb2766 Add the ability for the pageout daemon to measure stats on memory usage before
the system is out of memory.  The daemon does a minimal amount of work that
increases as the system becomes more likely to run out of memory and page in/out.

The default tuning is fairly low in background CPU usage, and sysctl variables
have been added to enable flexable operation.  This is an experimental feature
that will likely be changed and improved over time.
1997-07-27 04:49:19 +00:00
John Dyson
11cccda1de Fix a very subtile problem that causes unnessary numbers of objects backing
a single logical object.
Submitted by:	Alan Cox <alc@cs.rice.edu>
1997-07-27 04:44:12 +00:00
John Dyson
0a0a85b3e0 Add support for 4MB pages. This includes the .text, .data, .data parts
of the kernel, and also most of the dynamic parts of the kernel.  Additionally,
4MB pages will be allocated for display buffers as appropriate (only.)

The 4MB support for SMP isn't complete, but doesn't interfere with operation
either.
1997-07-17 04:34:03 +00:00
Tor Egge
208d433777 Don't try upgrading an existing exclusive lock in vm_map_user_pageable.
This should close PR kern/3180.
Also remove a bogus unconditional call to vm_map_unlock_read in
vm_map_lookup.
1997-06-23 21:51:03 +00:00
Peter Wemm
3b18caba29 Kill some stale leftovers from the earlier attempts at SMP per-cpu pages 1997-06-22 15:47:16 +00:00
John Dyson
3c631446d3 Remove a window during running down a file vnode. Also, the OBJ_DEAD
flag wasn't being respected during vref(), et. al.  Note that this
isn't the eventual fix for the locking problem.  Fine grained SMP
in the VM and VFS code will require (lots) more work.
1997-06-22 03:00:24 +00:00
John Dyson
4a40e3d42f Correct the return code for the mlock system call. Also add the stubs
for mlockall and munlockall.
1997-06-15 23:35:32 +00:00
John Dyson
dbc806e731 Fix a reference problem with maps. Only appears to manifest itself when
sharing address spaces.
1997-06-15 23:33:52 +00:00
Peter Wemm
0228905ae4 Update the #include "opt_smpxxx.h" includes - opt_smp.h isn't needed
very much in the generic parts of the kernel now.
1997-05-29 02:57:22 +00:00
Doug Rabson
32ad9cb531 Fix a few bugs with NFS and mmap caused by NFS' use of b_validoff
and b_validend.  The changes to vfs_bio.c are a bit ugly but hopefully
can be tidied up later by a slight redesign.

PR:		kern/2573, kern/2754, kern/3046 (possibly)
Reviewed by:	dyson
1997-05-19 14:36:56 +00:00
John Dyson
6160099735 Check the correct queue for waking up the pageout daemon. Specifically,
the pageout daemon wasn't always being waken up appropriately when the
(cache + free) queues were depleted.
Submitted by:	David S. Miller <davem@jenolan.rutgers.edu>
1997-05-01 14:36:01 +00:00
Peter Wemm
477a642cee Man the liferafts! Here comes the long awaited SMP -> -current merge!
There are various options documented in i386/conf/LINT, there is more to
come over the next few days.

The kernel should run pretty much "as before" without the options to
activate SMP mode.

There are a handful of known "loose ends" that need to be fixed, but
have been put off since the SMP kernel is in a moderately good condition
at the moment.

This commit is the result of the tinkering and testing over the last 14
months by many people.  A special thanks to Steve Passe for implementing
the APIC code!
1997-04-26 11:46:25 +00:00
Peter Wemm
92da7e012d Send this to the Attic so there's no mixups over which kern_lock.c is in
use in -current.
1997-04-21 13:39:56 +00:00
Peter Wemm
e108835bbc Unused variable (upobj is now purely handled within pmap) 1997-04-14 03:40:42 +00:00
John Dyson
5856e12e69 Fully implement vfork. Vfork is now much much faster than even our
fork. (On my machine, fork is about 240usecs, vfork is 78usecs.)

Implement rfork(!RFPROC !RFMEM), which allows a thread to divorce its memory
	from the other threads of a group.

Implement rfork(!RFPROC RFCFDG), which closes all file descriptors, eliminating
	possible existing shares with other threads/processes.

Implement rfork(!RFPROC RFFDG), which divorces the file descriptors for a
	thread from the rest of the group.

Fix the case where a thread does an exec.  It is almost nonsense for a thread
	to modify the other threads address space by an exec, so we
	now automatically divorce the address space before modifying it.
1997-04-13 01:48:35 +00:00
Peter Wemm
a2a1c95c10 The biggie: Get rid of the UPAGES from the top of the per-process address
space. (!)

Have each process use the kernel stack and pcb in the kvm space.  Since
the stacks are at a different address, we cannot copy the stack at fork()
and allow the child to return up through the function call tree to return
to user mode - create a new execution context and have the new process
begin executing from cpu_switch() and go to user mode directly.
In theory this should speed up fork a bit.

Context switch the tss_esp0 pointer in the common tss.  This is a lot
simpler since than swithching the gdt[GPROC0_SEL].sd.sd_base pointer
to each process's tss since the esp0 pointer is a 32 bit pointer, and the
sd_base setting is split into three different bit sections at non-aligned
boundaries and requires a lot of twiddling to reset.

The 8K of memory at the top of the process space is now empty, and unmapped
(and unmappable, it's higher than VM_MAXUSER_ADDRESS).

Simplity the pmap code to manage process contexts, we no longer have to
double map the UPAGES, this simplifies and should measuably speed up fork().

The following parts came from John Dyson:

Set PG_G on the UPAGES that are now in kernel context, and invalidate
them when swapping them out.

Move the upages object (upobj) from the vmspace to the proc structure.

Now that the UPAGES (pcb and kernel stack) are out of user space, make
rfork(..RFMEM..) do what was intended by sharing the vmspace
entirely via reference counting rather than simply inheriting the mappings.
1997-04-07 07:16:06 +00:00
Peter Wemm
2100d64585 Commit a typo fix that's been sitting in my tree for ages, quite forgotten.
The typo was detected once apon a time with the -Wunused compile option.
The result was that a block of code for implementing
madvise(.. MADV_SEQUENTIAL..) behavior was "dead" and unused, probably
negating the effect of activating the option.

Reviewed by: dyson
1997-04-06 16:16:11 +00:00
John Dyson
7d78abc9d9 Make vm_map_protect be more complete about map simplification. This
is useful when a process changes it's page range protections very
much.
Submitted by:	Alan Cox <alc@cs.rice.edu>
1997-04-06 03:04:31 +00:00
John Dyson
15cb98465f Correction to the prototype for vm_fault. 1997-04-06 02:30:56 +00:00
John Dyson
a04c970a7a Fix the gdb executable modify problem. Thanks to the detective work
by Alan Cox <alc@cs.rice.edu>, and his description of the problem.

The bug was primarily in procfs_mem, but the mistake likely happened
due to the lack of vm system support for the operation.  I added
better support for selective marking of page dirty flags so that
vm_map_pageable(wiring) will not cause this problem again.

The code in procfs_mem is now less bogus (but maybe still a little
so.)
1997-04-06 02:29:45 +00:00
Bruce Evans
3f39dbc52d Removed potentially harmful garbage <vm/lock.h> and fixed bogus
use of it.  It was actually harmless because the use was null due
to fortuitous include orders and identical (wrong) idempotency
macros.
1997-04-01 08:39:07 +00:00
David Greenman
9caaadb63a Changed the way that the exec image header is read to be filesystem-
centric rather than VM-centric to fix a problem with errors not being
detectable when the header is read.
Killed exech_map as a result of these changes.
There appears to be no performance difference with this change.
1997-03-31 11:11:26 +00:00
Bruce Evans
3ac4d1ef0c Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.
Fixed everything that depended on getting fcntl.h stuff from the wrong
place.  Most things don't depend on file.h stuff at all.
1997-03-23 03:37:54 +00:00
John Dyson
c5d593ae63 Fix a significant error in the accounting for pre-zeroed pages. This
is a candidate for RELENG_2_2...
1997-03-23 02:44:54 +00:00
John Dyson
eb2c768ebb When removing IN_RECURSE support during the Lite/2 merge, read/write
to/from mmaped regions was broken.  This commit fixes the breakage, and
uses the new Lite/2 locking mechanisms.
1997-03-08 04:33:47 +00:00
Bruce Evans
2f558c3e59 Removed a wrong LK_INTERLOCK flag. 1997-02-27 15:38:41 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Bruce Evans
697030ed3d Removed vestiges of Mach lock types.
vm_map.h:
Removed #include of <sys/proc.h>.  curproc is only used in some macros
and users of the macros already include <sys/proc.h>.
1997-02-18 14:07:03 +00:00
Garrett Wollman
10825343b0 Provide an alternative interface to contigmalloc() which allows a specific
map to be used when allocating the kernel va (e.g., mb_map).  The VM
gurus may want to look this over.
1997-02-13 19:37:40 +00:00
John Dyson
996c772f58 This is the kernel Lite/2 commit. There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>
1997-02-10 02:22:35 +00:00
John Dyson
5069bf5747 Another fix to inheriting shared segments. Do the copy on write
thing if needed.
Submitted by:	Alan Cox <alc@cs.rice.edu>
1997-01-31 04:10:41 +00:00
David Greenman
098415100b Added a check/panic for v_usecount being 0 (no vnode reference) in
vnode_pager_alloc().
1997-01-24 22:20:23 +00:00
John Dyson
fed9a9032e Fix two problems where a NULL object is dereferenced. One problem
was in the VM_INHERIT_SHARE case of vmspace_fork, and also in vm_map_madvise.
Submitted by:	Alan Cox <alc@cs.rice.edu>
1997-01-22 01:34:48 +00:00
John Dyson
6e20a16589 Make MADV_FREE work better. Specifically, it did not wait for
the page to be unbusy, and it caused some algorithmic problems
as a result.  There were some other problems with it also, so
this is a general cleanup of the code.
Submitted by:	Douglas Crosher <dtc@scrooge.ee.swin.oz.au> and myself.
1997-01-20 02:25:14 +00:00
John Dyson
afa07f7e83 Change the map entry flags from bitfields to bitmasks. Allows
for some code simplification.
1997-01-16 04:16:22 +00:00
David Greenman
649c409d03 Fix bug related to map entry allocations where a sleep might be attempted
when allocating memory for network buffers at interrupt time. This is due
to inadequate checking for the new mcl_map. Fixed by merging mb_map and
mcl_map into a single mb_map.

Reviewed by:	wollman
1997-01-15 20:46:02 +00:00
Bruce Evans
16a02c1105 Removed redundant spl0()'s from kernel processes. They were work-arounds
for a bug in fork().
1997-01-15 19:05:08 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
John Dyson
d4a272db61 Slightly correct the code that moves pages from the active to the
inactive queue.  This is only a minor performance improvement, but will
not affect perf on machines that don't have ref bits.
1997-01-11 07:22:24 +00:00
John Dyson
9b5a5d81be Prepare better for multi-platform by eliminating another required
pmap routine (pmap_is_referenced.)  Upper level recoded to use
pmap_ts_referenced.
1997-01-11 07:19:02 +00:00
John Dyson
106031ef73 Undo the collapse breakage (swap space usage problem.) 1997-01-03 17:02:28 +00:00
John Dyson
3c018e7214 Guess what? We left alot of the old collapse code that is not needed
anymore with the "full" collapse fix that we added about 1yr ago!!!  The
code has been removed by optioning it out for now, so we can put it back
in ASAP if any problems are found.
1997-01-01 04:45:05 +00:00
John Dyson
8cc7e047a3 A very significant improvement in the management of process maps
and objects.  Previously, "fancy" memory management techniques
such as that used by the M3 RTS would have the tendancy of chopping
up processes allocated memory into lots of little objects.  Alan
has come up with some improvements to migtigate the sitution to
the point where even the M3 RTS only has one object for bss and
it's managed memory (when running CVSUP.)  (There are still cases where the
situation isn't improved when the system pages -- but this is much much
better for the vast majority of cases.)  The system will now be able
to much more effectively merge map entries.

Submitted by:	Alan Cox <alc@cs.rice.edu>
1996-12-31 16:23:38 +00:00
John Dyson
d0aea04fe0 Let the VM system know that on certain arch's that VM_PROT_READ
also implies VM_PROT_EXEC.  We support it that way for now,
since the break system call by default gives VM_PROT_ALL.  Now
we have a better chance of coalesing map entries when mixing
mmap/break type operations.  This was contributing to excessive
numbers of map entries on the modula-3 runtime system.  The
problem is still not "solved", but the situation makes more
sense.

Eventually, when we work on architectures where VM_PROT_READ
is orthogonal to VM_PROT_EXEC, we will have to visit this
issue carefully (esp. regarding security issues.)
1996-12-30 05:31:21 +00:00
John Dyson
bc0d333478 EEEK!!! useracc and kernacc didn't lock their respective
maps.  Additionally, eliminate the map->hint distortion
associated with useracc.  That may/may-not be the "right"
thing to do -- but time will tell.
Submitted by:	Partially by Alan Cox <alc@cs.rice.edu>
1996-12-30 03:56:11 +00:00
John Dyson
595236df9b Superficial cleanup of comment. 1996-12-29 02:33:12 +00:00
John Dyson
b7b2aac2b6 Eliminate the redundancy due to the similarity between the routines
vm_map_simplify and vm_map_simplify_entry.  Make vm_map_simplify_entry
handle wired maps so that we can get rid of vm_map_simplify.  Modify
the callers of vm_map_simplify to properly use vm_map_simplify_entry.
Submitted by:	Alan Cox <alc@cs.rice.edu>
1996-12-28 23:07:49 +00:00
John Dyson
94328e9057 The code unnecessarily created an object with no handle up-front, which
has the negative effect of disabling some map optimizations.  This
patch defers the creation of the object until it needs to be at fault time.
Submitted by:	Alan Cox <alc@cs.rice.edu>
1996-12-28 22:40:44 +00:00
Joerg Wunsch
e9822d926c Make DFLDSIZ and MAXDSIZ fully-supported options.
"Don't forget to do a ``make depend''" :-)
1996-12-22 23:17:09 +00:00
John Dyson
7aaaa4fd5d Implement closer-to POSIX mlock semantics. The major difference is
that we do allow mlock to span unallocated regions (of course, not
mlocking them.)  We also allow mlocking of RO regions (which the old
code couldn't.)  The restriction there is that once a RO region is
wired (mlocked), it cannot be debugged (or EVER written to.)

Under normal usage, the new mlock code will be a significant improvement
over our old stuff.
1996-12-14 17:54:17 +00:00
John Dyson
0362d7d737 Expunge inlines... 1996-12-07 07:44:05 +00:00
John Dyson
62487bb4db Fix a map entry leak problem found by DG. Also, de-inline a function
vm_map_entry_dispose, because it won't help being inlined.
1996-12-07 06:19:37 +00:00
John Dyson
cdc2c29161 Make vm_map_insert much more intelligent in the MAP_NOFAULT case so
that map entries are coalesced when appropriate.  Also, conditionalize
some code that is currently not used in vm_map_insert.  This mod
has been added to eliminate unnecessary map entries in buffer map.

Additionally, there were some cases where map coalescing could be done
when it shouldn't.  That problem has been resolved.
1996-12-07 00:03:43 +00:00
John Dyson
09e0c6ccdd Implement a new totally dynamic (up to MAXPHYS) buffer kva allocation
scheme.  Additionally, add the capability for checking for unexpected
kernel page faults.  The maximum amount of kva space for buffers hasn't
been decreased from where it is, but it will now be possible to do so.

This scheme manages the kva space similar to the buffers themselves.  If
there isn't enough kva space because of usage or fragementation, buffers
will be reclaimed until a buffer allocation is successful.  This scheme
should be very resistant to fragmentation problems until/if the LFS code
is fixed and uses the bogus buffer locking scheme -- but a 'fixed' LFS
is not likely to use such a scheme.

Now there should be NO problem allocating buffers up to MAXPHYS.
1996-11-30 22:41:49 +00:00
John Dyson
e0c5a895f1 Make the kernel smaller with at worst a neutral effect on perf by
de-inlining some VM calls.  (Actually, I measured a small improvement.)
1996-11-28 23:15:07 +00:00
John Dyson
5b0a74089d Improve the locality of reference for variables in vm_page and
vm_kern by moving them from .bss to .data.  With this change,
there is a measurable perf improvement in fork/exec.
1996-11-17 02:38:31 +00:00
John Dyson
db2c0faa4c Vastly improved contigmalloc routine. It does not solve the
problem of allocating contiguous buffer memory in general, but
make it much more likely to work at boot-up time.  The best
chance for an LKM-type load of a sound driver is immediately
after the mount of the root filesystem.

This appears to work for a 64K allocation on an 8MB system.
1996-11-05 04:19:08 +00:00
John Dyson
851c12ff1d Change mmap to use OBJT_DEFAULT instead of OBJT_SWAP by default
for anonymous objects.  The system will automatically change the
type to SWAP if needed (for size or pageout reasons.)
1996-10-29 22:07:11 +00:00
Poul-Henning Kamp
281cd9b020 The way we get a vnode for swapdev is not quite kosher. In particular
it breaks in the DEVFS_ROOT case.  replicate a bit too much of bdevvp()
in here to circumvent the problem.  The real problem is the magic that
lives in bdevsw[1].
1996-10-27 22:31:00 +00:00
John Dyson
fcae040bc0 Remove a bogus optimization in the mmap code. It is superfluous,
and at best is the same speed as the unoptimized code.  At worst, it
slows down trivial programs.
1996-10-24 02:56:23 +00:00
John Dyson
a669a6e9a9 Make processes waken up eligible for immediate swap-in. 1996-10-17 02:58:20 +00:00
John Dyson
ad98052216 Clean up the rundown of the object backing a vnode. This should fix
NFS problems associated with forcible dismounts.
1996-10-17 02:49:35 +00:00
Bruce Evans
aad9af2ba3 Removed nested include of <sys/proc.h> from <vm/vm_object.h> and fixed
the one place that depended on it.  wakeup() is now prototyped in
<sys/systm.h> so that it is normally visible.

Added nested include of <sys/queue.h> in <vm/vm_object.h>.  The queue
macros are a more fundamental prerequisite for <vm/vm_object.h> than
the wakeup prototype and previously happened to be included by
namespace pollution from <sys/proc.h> or elsewhere.
1996-10-15 18:24:34 +00:00
John Dyson
675878e732 Move much of the machine dependent code from vm_glue.c into
pmap.c.  Along with the improved organization, small proc fork
performance is now about 5%-10% faster.
1996-10-15 03:16:45 +00:00
Poul-Henning Kamp
1111860c29 Remove a stale comment. 1996-10-13 07:16:50 +00:00
Bruce Evans
8ba0c490a9 Removed __pure's and __pure2's. __pure is a no-op for recent versions
of gcc by definition, and __pure2 is a no-op in effect (presumably the
compiler can see when an inline function has no side effects).
1996-10-12 20:09:48 +00:00
John Dyson
853a7bc893 Make the default cache size optim to be 256K, the old default was
64K.  The change has essentially neutral effect on those machines with
little or no cache, and has a positive effect on "normal" machines
with 256K or more cache.
1996-10-06 22:26:13 +00:00
John Dyson
f7d6dab2fd Fix a problem with the page coloring code that the system will not always
be able to use all of the free pages.  This can manifest as a panic
using DIAGNOSTIC, or as a panic on an indirect memory reference.
1996-10-06 18:27:39 +00:00
Bruce Evans
322dfc2bd5 Fixed undeclared variables for the !(PQ_L2_SIZE > 1) case.
Removed redundant #include.
1996-09-28 17:53:18 +00:00
John Dyson
a2f4a84696 Reviewed by:
Submitted by:
Obtained from:
1996-09-28 03:33:40 +00:00
David Greenman
cd6eea255f Fixed bug with reversed trunc/round_page() in madvise...start must be
trunced, end must be rounded.
1996-09-19 10:12:41 +00:00
Bruce Evans
dd106ca742 Removed iprintf(). It was copied to db_iprintf() in ddb. 1996-09-15 11:24:21 +00:00
Bruce Evans
c7c34a24a3 Attached vm ddb commands show map', show vmochk', `show object',
`show vmopag', `show page' and `show pageq'.  Moved all vm ddb stuff
to the ends of the vm source files.

Changed printf() to db_printf(), `indent' to db_indent, and iprintf()
to db_iprintf() in ddb commands.  Moved db_indent and db_iprintf()
from vm to ddb.

vm_page.c:
Don't use __pure.  Staticized.

db_output.c:
Reduced page width from 80 to 79 to inhibit double spacing for long
lines (there are still some problems if words are printed across
column 79).
1996-09-14 11:54:59 +00:00
John Dyson
9fea9a6f5b The whole issue of not support VOP_LOCK for VBLK devices should be
rethought.  This fixes YET another problem with unmounting filesystems.
The root cause is not fixed here, but at least the problem has gone
away.
1996-09-10 05:28:23 +00:00
John Dyson
4334b0d815 Fixed the use of the wrong variable in vm_map_madvise. 1996-09-08 23:49:47 +00:00
John Dyson
5070c7f8c5 Addition of page coloring support. Various levels of coloring are afforded.
The default level works with minimal overhead, but one can also enable
full, efficient use of a 512K cache.  (Parameters can be generated
to support arbitrary cache sizes also.)
1996-09-08 20:44:49 +00:00
John Dyson
b8e251a56d Improve the scalability of certain pmap operations. 1996-09-08 16:57:53 +00:00
John Dyson
6476c0d204 Even though this looks like it, this is not a complex code change.
The interface into the "VMIO" system has changed to be more consistant
and robust.  Essentially, it is now no longer necessary to call vn_open
to get merged VM/Buffer cache operation, and exceptional conditions
such as merged operation of VBLK devices is simpler and more correct.

This code corrects a potentially large set of problems including the
problems with ktrace output and loaded systems, file create/deletes,
etc.

Most of the changes to NFS are cosmetic and name changes, eliminating
a layer of subroutine calls.  The direct calls to vput/vrele have
been re-instituted for better cross platform compatibility.

Reviewed by: davidg
1996-08-21 21:56:23 +00:00
John Dyson
67bf686897 Backed out the recent changes/enhancements to the VM code. The
problem with the 'shell scripts' was found, but there was a 'strange'
problem found with a 486 laptop that we could not find.  This commit
backs the code back to 25-jul, and will be re-entered after the snapshot
in smaller (more easily tested) chunks.
1996-07-30 03:08:57 +00:00
David Greenman
0f281c28fa Slight performance tweak for previous commit. 1996-07-28 02:54:09 +00:00
John Dyson
f230c45cbe Undo part of the scalability commit. Many of the changes
in vm_fault had some performance enhancements not ready
for prime time.  This commit backs out some of the changes.
1996-07-28 01:14:01 +00:00
John Dyson
bf6dfc7b35 Allow sequentially created mmap'ed anonymous regions to coalesce. There
is little or no reason to create a swap pager for small mmap's.  The
vm_map_insert code will automatically create a swap pager if the object
becomes too large.  This fix, per a request from phk.
1996-07-27 17:21:41 +00:00
John Dyson
3b297e93b8 Clean up some lint. 1996-07-27 04:22:12 +00:00
John Dyson
feb32a8fa9 Remove experimental header file. My test-build must have picked it
up in an unexpected place.
Submitted by:	jkh
1996-07-27 04:06:11 +00:00
John Dyson
819c1c6f43 Missing (prototype) change from the previous commit. 1996-07-27 03:47:35 +00:00
John Dyson
4f4d35edf0 This commit is meant to solve a couple of VM system problems or
performance issues.

	1) The pmap module has had too many inlines, and so the
	   object file is simply bigger than it needs to be.
	   Some common code is also merged into subroutines.
	2) Removal of some *evil* PHYS_TO_VM_PAGE macro calls.
	   Unfortunately, a few have needed to be added also.
	   The removal caused the need for more vm_page_lookups.
	   I added lookup hints to minimize the need for the
	   page table lookup operations.
	3) Removal of some bogus performance improvements, that
	   mostly made the code more complex (tracking individual
	   page table page updates unnecessarily).  Those improvements
	   actually hurt 386 processors perf (not that people who
	   worry about perf use 386 processors anymore :-)).
	4) Changed pv queue manipulations/structures to be TAILQ's.
	5) The pv queue code has had some performance problems since
	   day one.  Some significant scalability issues are resolved
	   by threading the pv entries from the pmap AND the physical
	   address instead of just the physical address.  This makes
	   certain pmap operations run much faster.  This does
	   not affect most micro-benchmarks, but should help loaded system
	   performance *significantly*.  DG helped and came up with most
	   of the solution for this one.
	6) Most if not all pmap bit operations follow the pattern:
		pmap_test_bit();
		pmap_clear_bit();
	   That made for twice the necessary pv list traversal.   The
	   pmap interface now supports only pmap_tc_bit type operations:
	   pmap_[test/clear]_modified, pmap_[test/clear]_referenced.
	   Additionally, the modified routine now takes a vm_page_t arg
	   instead of a phys address.  This eliminates a PHYS_TO_VM_PAGE
	   operation.
	7) Several rewrites of routines that contain redundant code to
	   use common routines, so that there is a greater likelihood of
	   keeping the cache footprint smaller.
1996-07-27 03:24:10 +00:00
Bruce Evans
6ab46d52a5 Don't use NULL in non-pointer contexts. 1996-07-12 04:12:25 +00:00
John Dyson
502ba6e4a8 Back-off on the previous commit, specifically remove the look-ahead
optimization on the active queue scan.  I will do this correctly later.
1996-07-08 03:22:55 +00:00
John Dyson
c8c4b40cca Fix a problem with the pageout daemon RSS limiting, where it degrades
performance to LRU or worse when RSS limiting takes effect.  Also,
make an end condition in the active queue scan more efficient in the
case where pages are removed from the active queue as a side effect
of a pmap operation.
1996-07-08 02:25:53 +00:00
David Greenman
9579ee641a In all special cases for spl or page_alloc where kmem_map is check for,
mb_map (a submap of kmem_map) must also be checked.
Thanks to wcarchive (err...sort of) for demonstrating this bug.
1996-07-07 03:27:41 +00:00
John Dyson
a6e6bcc5f4 Properly set the PG_MAPPED and PG_WRITEABLE flags. This fixes some potential
problems with vm_map_remove/vm_map_delete.
1996-07-02 02:08:02 +00:00
John Dyson
877329e059 Make -current consistant with -stable regarding time that a process
sleeps before being swapped out.  The time is increased from 4 secs to
10 secs.  Originally I had decreased it from 20 to 4, but that is a bit
severe.  20 is too long though.
1996-06-30 21:16:18 +00:00