1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

When PLATFORM_SMP is enabled, check if tunable hw.ncpu is set and valid

(>= 1 and <= real ncores) and set mp_ncpus to it.

Approved by:	andrew (mentor)
Differential Revision:	https://reviews.freebsd.org/D6151
This commit is contained in:
Emmanuel Vadot 2016-05-10 19:11:25 +00:00
parent e49345fa3d
commit 3a0f677c9d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299383

View File

@ -209,8 +209,16 @@ platform_delay(int usec, void *arg __unused)
void
platform_mp_setmaxid(void)
{
int ncpu;
PLATFORM_MP_SETMAXID(plat_obj);
if (TUNABLE_INT_FETCH("hw.ncpu", &ncpu)) {
if (ncpu >= 1 && ncpu <= mp_ncpus) {
mp_ncpus = ncpu;
mp_maxid = ncpu - 1;
}
}
}
void