diff options
author | mjacob <mjacob@FreeBSD.org> | 2001-06-22 16:03:23 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2001-06-22 16:03:23 +0000 |
commit | 4127a257567a5365815d05b08c15faa4fc54b909 (patch) | |
tree | 054c5afa9f0d9659b8ac77c13eb6fbc0ccdc72ce /sys | |
parent | 773adf0e44e60d9ff6424600d932d8fe823254e5 (diff) | |
download | FreeBSD-src-4127a257567a5365815d05b08c15faa4fc54b909.zip FreeBSD-src-4127a257567a5365815d05b08c15faa4fc54b909.tar.gz |
Temporary fix at least- define NCPU_PRESENT which will be mp_npcus for
SMP kernels, one (1) for non-SMP.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_mbuf.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/kern/subr_mbuf.c b/sys/kern/subr_mbuf.c index e285484..18efe4a 100644 --- a/sys/kern/subr_mbuf.c +++ b/sys/kern/subr_mbuf.c @@ -57,6 +57,15 @@ #endif /* + * SMP and non-SMP kernels clearly have a different number of possible cpus. + */ +#ifdef SMP +#define NCPU_PRESENT mp_ncpus +#else +#define NCPU_PRESENT 1 +#endif + +/* * The mbuf allocator is heavily based on Alfred Perlstein's * (alfred@FreeBSD.org) "memcache" allocator which is itself based * on concepts from several per-CPU memory allocators. The difference @@ -379,7 +388,7 @@ mb_init(void *dummy) /* * Allocate and initialize PCPU containers. */ - for (i = 0; i < mp_ncpus; i++) { + for (i = 0; i < NCPU_PRESENT; i++) { mb_list_mbuf.ml_cntlst[i] = malloc(sizeof(struct mb_pcpu_list), M_MBUF, M_NOWAIT); mb_list_clust.ml_cntlst[i] = malloc(sizeof(struct mb_pcpu_list), @@ -617,7 +626,7 @@ mb_alloc_wait(struct mb_lstmngr *mb_list) * Cycle all the PCPU containers. Increment starved counts if found * empty. */ - for (i = 0; i < mp_ncpus; i++) { + for (i = 0; i < NCPU_PRESENT; i++) { cnt_lst = MB_GET_PCPU_LIST_NUM(mb_list, i); MB_LOCK_CONT(cnt_lst); |