From c9b3a4a8b5cc6f7c3d5844846171e0ba41ab4cf8 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 30 May 2016 12:28:06 -0700 Subject: [PATCH 1/4] Make vm_pageout_wakeup_thresh a u_int rather than an int. It's a threshold for v_free_count, which is a u_int. This also lets us remove a cast in vm_paging_needed(). --- sys/sys/vmmeter.h | 4 ++-- sys/vm/vm_pageout.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h index d07eb27..9337aa3 100644 --- a/sys/sys/vmmeter.h +++ b/sys/sys/vmmeter.h @@ -118,7 +118,7 @@ struct vmmeter { extern struct vmmeter vm_cnt; -extern int vm_pageout_wakeup_thresh; +extern u_int vm_pageout_wakeup_thresh; /* * Return TRUE if we are under our severe low-free-pages threshold @@ -182,7 +182,7 @@ vm_paging_needed(void) { return (vm_cnt.v_free_count + vm_cnt.v_cache_count < - (u_int)vm_pageout_wakeup_thresh); + vm_pageout_wakeup_thresh); } /* diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 6156b6d..ecb1f9e 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -163,7 +163,7 @@ SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); int vm_pages_needed; /* Event on which pageout daemon sleeps */ int vm_pageout_deficit; /* Estimated number of pages deficit */ -int vm_pageout_wakeup_thresh; +u_int vm_pageout_wakeup_thresh; /* Free page threshold for pagedaemon wakeups */ static int vm_pageout_oom_seq = 12; #if !defined(NO_SWAPPING) -- 2.8.1