summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2015-08-27 20:38:45 +0000
committeralc <alc@FreeBSD.org>2015-08-27 20:38:45 +0000
commit02709dd7cd61a6dbfc253da7093d34502e9ff1ab (patch)
treebd472a15b8fb3ec44ac9c1e58ae21f04e8862548
parente60631af235f308ddbb685140faab314a5cc04b8 (diff)
downloadFreeBSD-src-02709dd7cd61a6dbfc253da7093d34502e9ff1ab.zip
FreeBSD-src-02709dd7cd61a6dbfc253da7093d34502e9ff1ab.tar.gz
In vm_pageout_scan(), simplify the logic for determining if a page can be
paged out and apply some nearby style fixes. In collaboration with: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation, EMC / Isilon Storage Division
-rw-r--r--sys/vm/vm_pageout.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 75d21d6..4a93fd2 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1029,10 +1029,9 @@ vm_pageout_scan(struct vm_domain *vmd, int pass)
struct vm_pagequeue *pq;
vm_object_t object;
long min_scan;
- int act_delta, addl_page_shortage, deficit, maxscan, page_shortage;
- int vnodes_skipped = 0;
- int maxlaunder, scan_tick, scanned;
- boolean_t queues_locked;
+ int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan;
+ int page_shortage, scan_tick, scanned, vnodes_skipped;
+ boolean_t pageout_ok, queues_locked;
/*
* If we need to reclaim memory ask kernel caches to return
@@ -1086,6 +1085,8 @@ vm_pageout_scan(struct vm_domain *vmd, int pass)
if (pass > 1)
maxlaunder = 10000;
+ vnodes_skipped = 0;
+
/*
* Start scanning the inactive queue for pages we can move to the
* cache or free. The scan will stop when the target is reached or
@@ -1265,23 +1266,22 @@ vm_pageout_scan(struct vm_domain *vmd, int pass)
* pressure where there are insufficient clean pages
* on the inactive queue, we may have to go all out.
*/
- int swap_pageouts_ok;
- int error;
- if ((object->type != OBJT_SWAP) && (object->type != OBJT_DEFAULT)) {
- swap_pageouts_ok = 1;
- } else {
- swap_pageouts_ok = !(defer_swap_pageouts || disable_swap_pageouts);
- swap_pageouts_ok |= (!disable_swap_pageouts && defer_swap_pageouts &&
- vm_page_count_min());
-
- }
+ if (object->type != OBJT_SWAP &&
+ object->type != OBJT_DEFAULT)
+ pageout_ok = TRUE;
+ else if (disable_swap_pageouts)
+ pageout_ok = FALSE;
+ else if (defer_swap_pageouts)
+ pageout_ok = vm_page_count_min();
+ else
+ pageout_ok = TRUE;
/*
* We don't bother paging objects that are "dead".
* Those objects are in a "rundown" state.
*/
- if (!swap_pageouts_ok || (object->flags & OBJ_DEAD)) {
+ if (!pageout_ok || (object->flags & OBJ_DEAD) != 0) {
vm_pagequeue_lock(pq);
vm_page_unlock(m);
VM_OBJECT_WUNLOCK(object);
OpenPOWER on IntegriCloud