summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2006-01-04 18:26:54 +0000
committernetchild <netchild@FreeBSD.org>2006-01-04 18:26:54 +0000
commitfbbb1e238e4a3b95dc7db123fce9e4c10f3a7065 (patch)
treeee29adea4d598fe38552d6704033bb6a7654a0a0 /sys/vm
parent2dc20513fee86125a2dc06a3bad2e8f60f6c300f (diff)
downloadFreeBSD-src-fbbb1e238e4a3b95dc7db123fce9e4c10f3a7065.zip
FreeBSD-src-fbbb1e238e4a3b95dc7db123fce9e4c10f3a7065.tar.gz
Prevent divide by zero, use default values in case one of the divisor's
is zero. Tested by: Randy Bush <randy@psg.com>
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/vm_pageq.c b/sys/vm/vm_pageq.c
index a743840..0acdf1b 100644
--- a/sys/vm/vm_pageq.c
+++ b/sys/vm/vm_pageq.c
@@ -79,7 +79,7 @@ vm_coloring_init(void)
setPQL2(&pq_cachesize, &pq_cachenways);
- if (pq_cachesize > 0)
+ if (pq_cachesize > 0 && pq_cachenways > 0 && PAGE_SIZE > 1024)
PQ_NUMCOLORS = pq_cachesize / (PAGE_SIZE/1024) / \
pq_cachenways;
else
OpenPOWER on IntegriCloud