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>
This commit is contained in:
Gleb Smirnoff 2013-07-23 11:16:40 +00:00
parent 5c6d5d5598
commit e28a647db6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253565
2 changed files with 4 additions and 3 deletions

View File

@ -104,4 +104,4 @@ counter_startup(void)
uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU);
}
SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH, counter_startup, NULL);
SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL);

View File

@ -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;