diff options
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/swap_pager.c | 4 | ||||
-rw-r--r-- | sys/vm/vm_meter.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_page.c | 31 | ||||
-rw-r--r-- | sys/vm/vm_pageout.c | 2 | ||||
-rw-r--r-- | sys/vm/vnode_pager.c | 3 |
5 files changed, 19 insertions, 23 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index b89a254..86c246c 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2282,10 +2282,8 @@ swapoff_one(struct swdevt *sp, struct ucred *cred) * of data we will have to page back in, plus an epsilon so * the system doesn't become critically low on swap space. */ - if (vm_cnt.v_free_count + vm_cnt.v_cache_count + swap_pager_avail < - nblks + nswap_lowat) { + if (vm_cnt.v_free_count + swap_pager_avail < nblks + nswap_lowat) return (ENOMEM); - } /* * Prevent further allocations on this device. diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 6e2199e..8c9351c 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -204,7 +204,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) } } mtx_unlock(&vm_object_list_mtx); - total.t_free = vm_cnt.v_free_count + vm_cnt.v_cache_count; + total.t_free = vm_cnt.v_free_count; return (sysctl_handle_opaque(oidp, &total, sizeof(total), req)); } diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ec721b2..9f4fe44 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1561,11 +1561,11 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) * for the request class. */ mtx_lock(&vm_page_queue_free_mtx); - if (vm_cnt.v_free_count + vm_cnt.v_cache_count > vm_cnt.v_free_reserved || + if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && - vm_cnt.v_free_count + vm_cnt.v_cache_count > vm_cnt.v_interrupt_free_min) || + vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count + vm_cnt.v_cache_count > 0)) { + vm_cnt.v_free_count > 0)) { /* * Can we allocate the page from a reservation? */ @@ -1752,11 +1752,11 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req, * below the lower bound for the allocation class? */ mtx_lock(&vm_page_queue_free_mtx); - if (vm_cnt.v_free_count + vm_cnt.v_cache_count >= npages + - vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && - vm_cnt.v_free_count + vm_cnt.v_cache_count >= npages + - vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count + vm_cnt.v_cache_count >= npages)) { + if (vm_cnt.v_free_count >= npages + vm_cnt.v_free_reserved || + (req_class == VM_ALLOC_SYSTEM && + vm_cnt.v_free_count >= npages + vm_cnt.v_interrupt_free_min) || + (req_class == VM_ALLOC_INTERRUPT && + vm_cnt.v_free_count >= npages)) { /* * Can we allocate the pages from a reservation? */ @@ -1916,11 +1916,11 @@ vm_page_alloc_freelist(int flind, int req) * Do not allocate reserved pages unless the req has asked for it. */ mtx_lock(&vm_page_queue_free_mtx); - if (vm_cnt.v_free_count + vm_cnt.v_cache_count > vm_cnt.v_free_reserved || + if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && - vm_cnt.v_free_count + vm_cnt.v_cache_count > vm_cnt.v_interrupt_free_min) || + vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count + vm_cnt.v_cache_count > 0)) + vm_cnt.v_free_count > 0)) m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, 0); else { mtx_unlock(&vm_page_queue_free_mtx); @@ -2448,7 +2448,7 @@ vm_page_reclaim_contig(int req, u_long npages, vm_paddr_t low, vm_paddr_t high, * Return if the number of free pages cannot satisfy the requested * allocation. */ - count = vm_cnt.v_free_count + vm_cnt.v_cache_count; + count = vm_cnt.v_free_count; if (count < npages + vm_cnt.v_free_reserved || (count < npages + vm_cnt.v_interrupt_free_min && req_class == VM_ALLOC_SYSTEM) || (count < npages && req_class == VM_ALLOC_INTERRUPT)) @@ -2731,7 +2731,7 @@ vm_page_free_wakeup(void) * some free. */ if (vm_pageout_pages_needed && - vm_cnt.v_cache_count + vm_cnt.v_free_count >= vm_cnt.v_pageout_free_min) { + vm_cnt.v_free_count >= vm_cnt.v_pageout_free_min) { wakeup(&vm_pageout_pages_needed); vm_pageout_pages_needed = 0; } @@ -3570,8 +3570,8 @@ vm_page_assert_pga_writeable(vm_page_t m, uint8_t bits) DB_SHOW_COMMAND(page, vm_page_print_page_info) { + db_printf("vm_cnt.v_free_count: %d\n", vm_cnt.v_free_count); - db_printf("vm_cnt.v_cache_count: %d\n", vm_cnt.v_cache_count); db_printf("vm_cnt.v_inactive_count: %d\n", vm_cnt.v_inactive_count); db_printf("vm_cnt.v_active_count: %d\n", vm_cnt.v_active_count); db_printf("vm_cnt.v_laundry_count: %d\n", vm_cnt.v_laundry_count); @@ -3586,8 +3586,7 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pageq_info) { int dom; - db_printf("pq_free %d pq_cache %d\n", - vm_cnt.v_free_count, vm_cnt.v_cache_count); + db_printf("pq_free %d\n", vm_cnt.v_free_count); for (dom = 0; dom < vm_ndomains; dom++) { db_printf( "dom %d page_cnt %d free %d pq_act %d pq_inact %d pq_laund %d\n", diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index cd7bfb6..a8a19f3 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -159,7 +159,7 @@ SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); #define VM_INACT_SCAN_RATE 2 int vm_pageout_deficit; /* Estimated number of pages deficit */ -int vm_pageout_wakeup_thresh; +u_int vm_pageout_wakeup_thresh; static int vm_pageout_oom_seq = 12; bool vm_pageout_wanted; /* Event on which pageout daemon sleeps */ bool vm_pages_needed; /* Are threads waiting for free pages? */ diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index efa72f38..06dff5e 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -1124,8 +1124,7 @@ vnode_pager_putpages(vm_object_t object, vm_page_t *m, int count, * daemon up. This should be probably be addressed XXX. */ - if (vm_cnt.v_free_count + vm_cnt.v_cache_count < - vm_cnt.v_pageout_free_min) + if (vm_cnt.v_free_count < vm_cnt.v_pageout_free_min) flags |= VM_PAGER_PUT_SYNC; /* |