Date: Mon, 22 Apr 2013 09:02:23 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249763 - head/sys/vm Message-ID: <201304220902.r3M92NB9074631@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Mon Apr 22 09:02:23 2013 New Revision: 249763 URL: http://svnweb.freebsd.org/changeset/base/249763 Log: Panic if UMA_ZONE_PCPU is created at early stages of boot, when mp_ncpus isn't yet initialized. Otherwise we will panic at first allocation later. Sponsored by: Nginx, Inc. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Apr 22 08:28:53 2013 (r249762) +++ head/sys/vm/uma_core.c Mon Apr 22 09:02:23 2013 (r249763) @@ -1139,6 +1139,7 @@ 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)); keg->uk_slabsize = sizeof(struct pcpu); keg->uk_ppera = howmany(mp_ncpus * sizeof(struct pcpu), PAGE_SIZE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304220902.r3M92NB9074631>