aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 18e83635d2e2..31553bdc380a 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1588,6 +1588,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex, int req,
{
vm_page_t m;
int flags, req_class;
+ u_int free_count;
KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) &&
(object != NULL || (req & VM_ALLOC_SBUSY) == 0) &&
@@ -1655,7 +1656,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex, int req,
* At this point we had better have found a good page.
*/
KASSERT(m != NULL, ("missing page"));
- vm_phys_freecnt_adj(m, -1);
+ free_count = vm_phys_freecnt_adj(m, -1);
mtx_unlock(&vm_page_queue_free_mtx);
vm_page_alloc_check(m);
@@ -1713,7 +1714,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pindex, int req,
* Don't wakeup too often - wakeup the pageout daemon when
* we would be nearly out of memory.
*/
- if (vm_paging_needed())
+ if (vm_paging_needed(free_count))
pagedaemon_wakeup();
return (m);
@@ -1899,7 +1900,7 @@ retry:
pmap_page_set_memattr(m, memattr);
pindex++;
}
- if (vm_paging_needed())
+ if (vm_paging_needed(vm_cnt.v_free_count))
pagedaemon_wakeup();
return (m_ret);
}
@@ -1948,7 +1949,7 @@ vm_page_t
vm_page_alloc_freelist(int flind, int req)
{
vm_page_t m;
- u_int flags;
+ u_int flags, free_count;
int req_class;
req_class = req & VM_ALLOC_CLASS_MASK;
@@ -1980,7 +1981,7 @@ vm_page_alloc_freelist(int flind, int req)
mtx_unlock(&vm_page_queue_free_mtx);
return (NULL);
}
- vm_phys_freecnt_adj(m, -1);
+ free_count = vm_phys_freecnt_adj(m, -1);
mtx_unlock(&vm_page_queue_free_mtx);
vm_page_alloc_check(m);
@@ -2002,7 +2003,7 @@ vm_page_alloc_freelist(int flind, int req)
}
/* Unmanaged pages don't use "act_count". */
m->oflags = VPO_UNMANAGED;
- if (vm_paging_needed())
+ if (vm_paging_needed(free_count))
pagedaemon_wakeup();
return (m);
}