Back in the days when the kernel was single threaded, testing
"vm_paging_target() > 0" was a reasonable way of determining if the inactive queue scan met its target. However, now that other threads can be allocating pages while the inactive queue scan is running, it's an unreliable method. The effect of it being unreliable is that we can start swapping out processes when we didn't intend to. This issue has existed since the kernel was multithreaded, but the changes to the inactive queue target in 10.0-RELEASE have made its effects visible. This change introduces a more direct method for determining if the inactive queue scan met its target that is not affected by the actions of other threads. Reported by: Steve Polyack Tested by: pho, Steve Polyack (an earlier version) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
e86447ca44
commit
9452b5eda9
@ -1299,6 +1299,23 @@ relock_queues:
|
||||
}
|
||||
vm_pagequeue_unlock(pq);
|
||||
|
||||
#if !defined(NO_SWAPPING)
|
||||
/*
|
||||
* Wakeup the swapout daemon if we didn't cache or free the targeted
|
||||
* number of pages.
|
||||
*/
|
||||
if (vm_swap_enabled && page_shortage > 0)
|
||||
vm_req_vmdaemon(VM_SWAP_NORMAL);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Wakeup the sync daemon if we skipped a vnode in a writeable object
|
||||
* and we didn't cache or free enough pages.
|
||||
*/
|
||||
if (vnodes_skipped > 0 && page_shortage > vm_cnt.v_free_target -
|
||||
vm_cnt.v_free_min)
|
||||
(void)speedup_syncer();
|
||||
|
||||
/*
|
||||
* Compute the number of pages we want to try to move from the
|
||||
* active queue to the inactive queue.
|
||||
@ -1408,20 +1425,6 @@ relock_queues:
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If we didn't get enough free pages, and we have skipped a vnode
|
||||
* in a writeable object, wakeup the sync daemon. And kick swapout
|
||||
* if we did not get enough free pages.
|
||||
*/
|
||||
if (vm_paging_target() > 0) {
|
||||
if (vnodes_skipped && vm_page_count_min())
|
||||
(void) speedup_syncer();
|
||||
#if !defined(NO_SWAPPING)
|
||||
if (vm_swap_enabled && vm_page_count_target())
|
||||
vm_req_vmdaemon(VM_SWAP_NORMAL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are critically low on one of RAM or swap and low on
|
||||
|
Loading…
x
Reference in New Issue
Block a user