Commit Graph

83 Commits

Author SHA1 Message Date
David Greenman
45cbbb298d Do vm_page_rename more conservatively in rcollapse and qcollapse, and
change list walk so that it doesn't get stuck in an infinite loop.

Submitted by:	 John Dyson
1994-12-23 05:00:19 +00:00
David Greenman
7609ab12e4 Initialize b_vnbuf.le_next before returning a new buffer in getpbuf and
trypbuf. Move a couple of splbio's to be slightly less conservative.
1994-12-23 04:56:51 +00:00
David Greenman
6f7bc393bb Fixed a benign off by one error. 1994-12-22 05:18:12 +00:00
David Greenman
6185408336 Don't ever clear B_BUSY on a pbuf (or any other flag for that matter).
This appears to be the cause of some buffer confusion that leads to
a panic during heavy paging.

Submitted by:	 John Dyson
1994-12-19 00:02:56 +00:00
David Greenman
66ecebed58 Fixed multiple bogons with the map entry handling. 1994-12-18 13:58:41 +00:00
David Greenman
053bbc788c Fixed bug where statically allocated map entries might be freed to the
malloc pool...causing a panic.

Submitted by:	John Dyson
1994-12-18 10:28:40 +00:00
David Greenman
dd0bd066e0 Change swapping policy to be a bit more aggressive about finding a
candidate for swapout. Increased default RSS limit to a minimum of 2MB.
1994-12-18 06:31:31 +00:00
David Greenman
8d6e8ede62 Protect kmem_map modifications with splhigh() to work around a problem with
the map being locked at interrupt time.
1994-12-15 22:47:11 +00:00
David Greenman
7b18a71899 Don't put objects that have no parent on the reverse_shadow_list. Problem
identified and explained by Gene Stark (thanks Gene!).

Submitted by:	John Dyson
1994-12-11 01:36:53 +00:00
David Greenman
eadf9e27cd These changes fix a couple of lingering VM problems:
1.	The pageout daemon used to block under certain
	circumstances, and we needed to add new functionality
	that would cause the pageout daemon to block more often.
	Now, the pageout daemon mostly just gets rid of pages
	and kills processes when the system is out of swap.
	The swapping, rss limiting and object cache trimming
	have been folded into a new daemon called "vmdaemon".
	This new daemon does things that need to be done for
	the VM system, but can block.  For example, if the
	vmdaemon blocks for memory, the pageout daemon
	can take care of it.  If the pageout daemon had
	blocked for memory, it was difficult to handle
	the situation correctly (and in some cases, was
	impossible).

2.	The collapse problem has now been entirely fixed.
	It now appears to be impossible to accumulate unnecessary
	vm objects.  The object collapsing now occurs when ref counts
	drop to one (where it is more likely to be more simple anyway
	because less pages would be out on disk.)  The original
	fixes were incomplete in that pathological circumstances
	could still be contrived to cause uncontrolled growth
	of swap.  Also, the old code still, under steady state
	conditions, used more swap space than necessary.  When
	using the new code, users will generally notice a
	significant decrease in swap space usage, and theoretically,
	the system should be leaving fewer unused pages around
	competing for memory.

Submitted by:	John Dyson
1994-11-25 07:58:29 +00:00
David Greenman
4abc71c008 Don't try to page to a vnode that had it's filesystem unmounted. 1994-11-24 14:43:22 +00:00
David Greenman
d49456add7 Preallocate the first swap block to work around a failure with swap starting
at physical block 0. Note that this will show up in pstat -s and swapinfo
as space "in use". In reality, the space is simply never made available.
1994-11-22 08:47:20 +00:00
David Greenman
792216316f Don't ever try to kill off process 1 - even if we are out of swap space
and it's the candidate pig.
1994-11-17 06:24:25 +00:00
Justin T. Gibbs
bf556a1617 Remove a peice of commented out code that was left over from the early
stages of debugging LFS:

         * if we can't bmap, use old VOP code
         */
!       if (/* (vp->v_mount && vp->v_mount->mnt_stat.f_type == MOUNT_LFS) || */
!               VOP_BMAP(vp, foff, &dp, 0, 0)) {
                for (i = 0; i < count; i++) {
                        if (i != reqpage) {
                                vnode_pager_freepage(m[i]);
--- 804,810 ----
        /*
         * if we can't bmap, use old VOP code
         */
!       if (VOP_BMAP(vp, foff, &dp, 0, 0)) {

Reviewed by: gibbs
Submitted by: John Dyson
1994-11-17 01:22:45 +00:00
Bruce Evans
4f21005bdd pmap.h:
Disable the bogus declaration of pmap_bootstrap().  Since its arg list
is machine-dependent, it must be declared in a machine-dependent header.

vm_page.h:
Change `inline' to `__inline' and old-style function parameter lists for
inlined functions to new-style.

`inline' and old-style function parameter lists should never be used in
system headers, even in very machine-dependent ones, because they cause
warnings from gcc -Wreally-all.
1994-11-14 08:19:08 +00:00
David Greenman
b0150bfc4b Set laundry flag when transitioning an inactive page from clean to dirty.
This fixes a performance bug where pages would sometimes not be paged
out when they could be.

Submitted by:	John Dyson
1994-11-14 02:57:40 +00:00
David Greenman
317205ca28 Fixed bug where a read-behind to a negative offset would occur if the
fault was at offset 0 in the object. This resulted in more overhead but
was othewise benign. Added incore() check in vnode_pager_has_page()
to work around a problem with LFS...other than slightly higher overhead,
this change has no affect on UFS.
1994-11-13 22:48:55 +00:00
David Greenman
24ea4a9671 Fixed bugs in accounting of swap space that resulted in the pager thinking
it was out of space when it really wasn't.

Submitted by:	John Dyson
1994-11-13 15:36:48 +00:00
David Greenman
bfbfac11c9 Implemented swap locking via P_SWAPPING flag. It was possible for a process
to be chosen for swap-in while it was being swapped-out. This was BAD.

Submitted by:	John Dyson
1994-11-13 12:47:07 +00:00
David Greenman
a83c285c7e Fixed return status from pagers. Ahem...the previous method would manufacture
data when it couldn't get it legitimately. :-(

Submitted by:	John Dyson
1994-11-06 09:55:31 +00:00
David Greenman
2fe6e4d71e Added support for starting the experimental "vmdaemon" system process.
Enabled via REL2_1.

Added support for doing object collapses "on the fly". Enabled via REL2_1a.

Improved object collapses so that they can happen in more cases. Improved
sensing of modified pages to fix an apparant race condition and improve
clustered pageout opportunities. Fixed an "oops" with not restarting page
scan after a potential block in vm_pageout_clean() (not doing this can result
in strange behavior in some cases).

Submitted by:	John Dyson & David Greenman
1994-11-06 05:07:53 +00:00
David Greenman
1b119d9d17 Improved I/O error reporting. 1994-10-25 07:06:20 +00:00
David Greenman
191ee5b300 #if 0'd out the object cache trimming code - there are multiple ways
that the pageout daemon can deadlock otherwise.

Submitted by:	John Dyson
1994-10-25 05:35:44 +00:00
David Greenman
e8fbe458e4 Fixed object cache trimming policy so it actually works.
Submitted by:	John Dyson
1994-10-23 21:03:09 +00:00
David Greenman
389918ee95 Adjusted reserved levels to fix a deadlock condition.
Submitted by:	John Dyson
1994-10-23 20:53:33 +00:00
David Greenman
47c9acfdeb Changed a thread_sleep into an spl protected tsleep. A deadlock can occur
otherwise. Minor efficiency improvement in vm_page_free().

Submitted by:	John Dyson
1994-10-23 06:15:04 +00:00
Poul-Henning Kamp
2fc59d0032 Contrary to my last commit here: NFS-swap is enabled automatically. 1994-10-22 17:53:35 +00:00
David Greenman
36df951444 Fixed a comment from the previous commit. 1994-10-22 02:41:19 +00:00
David Greenman
5663e6de1c Various changes to allow operation without any swapspace configured. Note
that this is intended for use only in floppy situations and is done at
the sacrifice of performance in that case (in ther words, this is not the
best solution, but works okay for this exceptional situation).

Submitted by:	John Dyson
1994-10-22 02:18:03 +00:00
Poul-Henning Kamp
2a054bc060 ATTENTION!
From now on, >all< swapdevices must be activated with "swapon".

If you havn't got it, add this line to /etc/fstab:
	/dev/wd0b	none	swap	sw	0 0
ne sec

Reason:
We want our GENERIC* kernels to have a large selection of swap-devices, but
on the other hand, we don't want to use a wd0b as swap when we boot of a
floppy.  This way, we will never use a unexpected swapdevice.  Nothing else
has changed.
1994-10-21 03:17:11 +00:00
Garrett Wollman
091b0456f4 Make my ALLDEVS kernel compile (basically, LINT minus a lot of options).
This involves fixing a few things I broke last time.
1994-10-21 01:19:28 +00:00
David Greenman
a58d1fa15d Fix the remaining vmmeter counters. They all now work correctly. 1994-10-18 14:59:20 +00:00
David Greenman
27de4e40b8 Put sanity check for negative hold count into #ifdef DIAGNOSTIC so that
it doesn't consume an extra 3k of kernel text because of gcc's bogus
inlining code.
1994-10-17 10:43:56 +00:00
David Greenman
976e77fc9c 1) Some of the counters in the vmmeter struct don't fit well into the Mach VM
scheme of things, so I've changed them to be more appropriate. page in/ous
   are now associated with the pager that did them. Nuked v_fault as the
   only fault of interest that wouldn't be already counted in v_trap is a VM
   fault, and this is counted seperately.
2) Implemented most of the remaining counters and corrected the counting of
   some that were done wrong. They are all almost correct now...just a few
   minor ones left to fix.
1994-10-15 13:33:09 +00:00
David Greenman
b8d95f1624 Count vm faults as v_vm_fault, not v_fault. 1994-10-15 10:33:47 +00:00
David Greenman
a08a17a3ce Properly count object lookups and hits. 1994-10-15 10:28:47 +00:00
David Greenman
b73f3b1da2 Got rid of redundant declaration warnings. 1994-10-14 12:26:18 +00:00
Jordan K. Hubbard
0a99546c0a Add missing )'s to previous midnight changes. :-) 1994-10-14 08:57:25 +00:00
David Greenman
2e1e24dd28 Fixed bug where page modifications would be lost when swap space was
almost depleted.

Reviewed by:	John Dyson
1994-10-14 01:58:52 +00:00
David Greenman
defb6744ba Changed I/O error messages to be somewhat less cryptic. Removed a piece
of unused code.
1994-10-14 00:57:19 +00:00
David Greenman
28e12d63f3 Fixed an object reference count problem that was caused by a call to
vm_object_lookup() being outside of some parens. The bug was introduced
via some recently added code.

Reviewed by:	John Dyson
1994-10-13 21:01:39 +00:00
David Greenman
35c10d2239 Got rid of map.h. It's a leftover from the rmap code, and we use rlists.
Changed swapmap into swaplist.
1994-10-09 07:35:18 +00:00
Poul-Henning Kamp
05f0fdd26a Cosmetics: unused vars, ()'s, #include's &c &c to silence gcc.
Reviewed by:	davidg
1994-10-09 01:52:19 +00:00
David Greenman
da8b3304fb Call resetpriority, not setpriority() ...oops.
Submitted by:	John Dyson
1994-10-09 00:18:22 +00:00
Poul-Henning Kamp
4e39a515d4 Cosmetics. Unused vars and other warnings. 1994-10-07 07:23:04 +00:00
David Greenman
8e58bf6875 Stuff object into v_vmdata rather than pager. Not important which at
the moment, but will be in the future. Other changes mostly cosmetic,
but are made for future VMIO considerations.

Submitted by:	John Dyson
1994-10-05 09:48:45 +00:00
David Greenman
5cedf6806b Fixed minor bug caused by some missing parens that can result in slightly
reduced paging performance by missing a clustering opportunity. Found
by Poul-Henning Kamp with gcc -Wall.
1994-10-05 09:02:53 +00:00
David Greenman
8baf4dac64 John Dyson's work in progress. Not currently used. 1994-10-04 07:32:08 +00:00
David Greenman
edaaafdb0f Fixed bug related to proper sensing of page modification that we
inadvertantly introduced in pre-1.1.5. This could cause page modifications
to go unnoticed during certain extreme low memory/high paging rate conditions.

Submitted by:	John Dyson and David Greenman
1994-10-04 03:05:09 +00:00
Poul-Henning Kamp
623ae52e4e GCC cleanup.
Reviewed by:
Submitted by:
Obtained from:
1994-10-02 17:48:58 +00:00