From owner-svn-src-head@FreeBSD.ORG Tue Jul 23 11:16:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 141E35BB; Tue, 23 Jul 2013 11:16:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 058D02846; Tue, 23 Jul 2013 11:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6NBGenq081218; Tue, 23 Jul 2013 11:16:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6NBGe6E081216; Tue, 23 Jul 2013 11:16:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201307231116.r6NBGe6E081216@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 23 Jul 2013 11:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253565 - in head/sys: kern vm 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.14 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, 23 Jul 2013 11:16:41 -0000 Author: glebius Date: Tue Jul 23 11:16:40 2013 New Revision: 253565 URL: http://svnweb.freebsd.org/changeset/base/253565 Log: Revert r249590 and in case if mp_ncpus isn't initialized use MAXCPU. This allows us to init counter zone at early stage of boot. Reviewed by: kib Tested by: Lytochkin Boris Modified: head/sys/kern/subr_counter.c head/sys/vm/uma_core.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Tue Jul 23 10:25:34 2013 (r253564) +++ head/sys/kern/subr_counter.c Tue Jul 23 11:16:40 2013 (r253565) @@ -104,4 +104,4 @@ counter_startup(void) uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH, counter_startup, NULL); +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL); Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Jul 23 10:25:34 2013 (r253564) +++ head/sys/vm/uma_core.c Tue Jul 23 11:16:40 2013 (r253565) @@ -1139,9 +1139,10 @@ keg_small_init(uma_keg_t keg) u_int shsize; if (keg->uk_flags & UMA_ZONE_PCPU) { - KASSERT(mp_ncpus > 0, ("%s: ncpus %d\n", __func__, mp_ncpus)); + u_int ncpus = mp_ncpus ? mp_ncpus : MAXCPU; + keg->uk_slabsize = sizeof(struct pcpu); - keg->uk_ppera = howmany(mp_ncpus * sizeof(struct pcpu), + keg->uk_ppera = howmany(ncpus * sizeof(struct pcpu), PAGE_SIZE); } else { keg->uk_slabsize = UMA_SLAB_SIZE;