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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to