summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-01-24 21:31:06 +0000
committeralc <alc@FreeBSD.org>2004-01-24 21:31:06 +0000
commit60b2122af9b426ea784f69f9c8d5875a1dab35da (patch)
treeaf9d8f2dbeafc80c1c20e83e3d444a41304eae88
parent28bee9f6356b5f01d1b2582dca2fb1381992c406 (diff)
downloadFreeBSD-src-60b2122af9b426ea784f69f9c8d5875a1dab35da.zip
FreeBSD-src-60b2122af9b426ea784f69f9c8d5875a1dab35da.tar.gz
1. Statically initialize swap_pager_full and swap_pager_almost_full to the
full state. (When swap is added their state will change appropriately.) 2. Set swap_pager_full and swap_pager_almost_full to the full state when the last swap device is removed. Combined these changes eliminate nonsense messages from the kernel on swap- less machines. Item 2 submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Prodding by: phk
-rw-r--r--sys/vm/swap_pager.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 2323aef..32fde4e 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -187,8 +187,8 @@ static void swapdev_strategy(struct buf *, struct swdevt *sw);
#define SWM_FREE 0x02 /* free, period */
#define SWM_POP 0x04 /* pop out */
-int swap_pager_full; /* swap space exhaustion (task killing) */
-static int swap_pager_almost_full; /* swap space exhaustion (w/ hysteresis)*/
+int swap_pager_full = 2; /* swap space exhaustion (task killing) */
+static int swap_pager_almost_full = 1; /* swap space exhaustion (w/hysteresis)*/
static int nsw_rcount; /* free read buffers */
static int nsw_wcount_sync; /* limit write buffers / synchronous */
static int nsw_wcount_async; /* limit write buffers / asynchronous */
@@ -2267,6 +2267,10 @@ found:
mtx_lock(&sw_dev_mtx);
TAILQ_REMOVE(&swtailq, sp, sw_list);
nswapdev--;
+ if (nswapdev == 0) {
+ swap_pager_full = 2;
+ swap_pager_almost_full = 1;
+ }
if (swdevhd == sp)
swdevhd = NULL;
mtx_unlock(&sw_dev_mtx);
OpenPOWER on IntegriCloud