summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-07-23 11:16:40 +0000
committerglebius <glebius@FreeBSD.org>2013-07-23 11:16:40 +0000
commit8a9169a4bacebc44492e96a0afc72be4c61ceea0 (patch)
tree50c0bc2b8fdbbdabb3ddbb944a23928e7f9d8ea7 /sys/vm
parent0f5a145fe0fcb6e9907f1458db21e478f874b760 (diff)
downloadFreeBSD-src-8a9169a4bacebc44492e96a0afc72be4c61ceea0.zip
FreeBSD-src-8a9169a4bacebc44492e96a0afc72be4c61ceea0.tar.gz
Revert r249590 and in case if mp_ncpus isn't initialized use MAXCPU. This
allows us to init counter zone at early stage of boot. Reviewed by: kib Tested by: Lytochkin Boris <lytboris gmail.com>
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/uma_core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 3a9492a..900209e 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -1139,9 +1139,10 @@ keg_small_init(uma_keg_t keg)
u_int shsize;
if (keg->uk_flags & UMA_ZONE_PCPU) {
- KASSERT(mp_ncpus > 0, ("%s: ncpus %d\n", __func__, mp_ncpus));
+ u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU;
+
keg->uk_slabsize = sizeof(struct pcpu);
- keg->uk_ppera = howmany(mp_ncpus * sizeof(struct pcpu),
+ keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu),
PAGE_SIZE);
} else {
keg->uk_slabsize = UMA_SLAB_SIZE;
OpenPOWER on IntegriCloud