Date: Tue, 10 May 2016 19:11:25 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299383 - head/sys/arm/arm Message-ID: <201605101911.u4AJBPWF035503@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: manu Date: Tue May 10 19:11:25 2016 New Revision: 299383 URL: https://svnweb.freebsd.org/changeset/base/299383 Log: 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 Modified: head/sys/arm/arm/platform.c Modified: head/sys/arm/arm/platform.c ============================================================================== --- head/sys/arm/arm/platform.c Tue May 10 18:28:38 2016 (r299382) +++ head/sys/arm/arm/platform.c Tue May 10 19:11:25 2016 (r299383) @@ -209,8 +209,16 @@ platform_delay(int usec, void *arg __unu 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605101911.u4AJBPWF035503>