summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-09-17 04:56:40 +0000
committerdillon <dillon@FreeBSD.org>1999-09-17 04:56:40 +0000
commit4cb1921c9b97c10844176bdd697e070b4af7e717 (patch)
treef570abee242d756236804e1630a4d34162994241 /sys/vm/vm_glue.c
parent2600195b6aa16ae0dd89bbb61802b1058238e31e (diff)
downloadFreeBSD-src-4cb1921c9b97c10844176bdd697e070b4af7e717.zip
FreeBSD-src-4cb1921c9b97c10844176bdd697e070b4af7e717.tar.gz
Reviewed by: Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com>
Replace various VM related page count calculations strewn over the VM code with inlines to aid in readability and to reduce fragility in the code where modules depend on the same test being performed to properly sleep and wakeup. Split out a portion of the page deactivation code into an inline in vm_page.c to support vm_page_dontneed(). add vm_page_dontneed(), which handles the madvise MADV_DONTNEED feature in a related commit coming up for vm_map.c/vm_object.c. This code prevents degenerate cases where an essentially active page may be rotated through a subset of the paging lists, resulting in premature disposal.
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index e53079a..1d7157c 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -209,19 +209,9 @@ vm_fork(p1, p2, flags)
p1->p_vmspace->vm_refcnt++;
}
- /*
- * Great, so we have a memory-heavy process and the
- * entire machine comes to a screaching halt because
- * nobody can fork/exec anything. What we really need
- * to do is fix the process swapper so it swaps out the right
- * processes.
- */
-#if 0
- while ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
- vm_pageout_deficit += (UPAGES + VM_INITIAL_PAGEIN);
+ while (vm_page_count_severe()) {
VM_WAIT;
}
-#endif
if ((flags & RFMEM) == 0) {
p2->p_vmspace = vmspace_fork(p1->p_vmspace);
@@ -339,8 +329,9 @@ scheduler(dummy)
int ppri;
loop:
- while ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_free_min) {
+ if (vm_page_count_min()) {
VM_WAIT;
+ goto loop;
}
pp = NULL;
OpenPOWER on IntegriCloud