From owner-svn-src-head@freebsd.org Tue May 10 19:11:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD781B36D90; Tue, 10 May 2016 19:11:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1931CA1; Tue, 10 May 2016 19:11:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4AJBPDX035504; Tue, 10 May 2016 19:11:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4AJBPWF035503; Tue, 10 May 2016 19:11:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201605101911.u4AJBPWF035503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 10 May 2016 19:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299383 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2016 19:11:26 -0000 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