summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-11-30 01:56:56 +0100
committerRichard Braun <rbraun@sceen.net>2016-11-30 02:06:09 +0100
commit4603229779d2ac08f52028f31108c90c853bae0d (patch)
treee920efafeea10a2f151c8b44fbdba4e7b39bb983
parent6c2f6ec6293a9f5b5caa441f379262a3c0510ec9 (diff)
VM: fix pageout stop condition
When checking whether to continue paging out or not, the pageout daemon only considers the high free page threshold of a segment. But if e.g. the default pager had to allocate reserved pages during a previous pageout cycle, it could have exhausted a segment (this is currently only seen with the DMA segment). In that case, the high threshold cannot be reached because the segment has currently no pageable page. This change makes the pageout daemon identify this condition and consider the segment as usable in order to make progress. The segment will simply be ignored on the allocation path for unprivileged threads, and if this happens with too many segments, the system will fail at allocation time. * vm/vm_page.c (vm_page_seg_usable): Report usable if the segment has no pageable page.
-rw-r--r--vm/vm_page.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm/vm_page.c b/vm/vm_page.c
index 2a9f27b2..567f23f3 100644
--- a/vm/vm_page.c
+++ b/vm/vm_page.c
@@ -939,6 +939,11 @@ vm_page_seg_page_available(const struct vm_page_seg *seg)
static boolean_t
vm_page_seg_usable(const struct vm_page_seg *seg)
{
+ if ((seg->nr_active_pages + seg->nr_inactive_pages) == 0) {
+ /* Nothing to page out, assume segment is usable */
+ return TRUE;
+ }
+
return (seg->nr_free_pages >= seg->high_free_pages);
}