From owner-svn-src-all@freebsd.org Thu Jun 8 21:33:21 2017 Return-Path: Delivered-To: svn-src-all@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 0D0ECD843D4; Thu, 8 Jun 2017 21:33:21 +0000 (UTC) (envelope-from glebius@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 D02227292D; Thu, 8 Jun 2017 21:33:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v58LXJ4A099477; Thu, 8 Jun 2017 21:33:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v58LXJ85099476; Thu, 8 Jun 2017 21:33:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201706082133.v58LXJ85099476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 8 Jun 2017 21:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319724 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 21:33:21 -0000 Author: glebius Date: Thu Jun 8 21:33:19 2017 New Revision: 319724 URL: https://svnweb.freebsd.org/changeset/base/319724 Log: When we are in UMA_STARTUP use startup_alloc() for any zone, not for internal zones only. This allows to create new zones at early stages of boot, without need to mark them as internal to UMA, which isn't always true. Reviewed by: alc Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 8 21:33:10 2017 (r319723) +++ head/sys/vm/uma_core.c Thu Jun 8 21:33:19 2017 (r319724) @@ -1384,8 +1384,6 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_reserve = 0; keg->uk_pages = 0; keg->uk_flags = arg->flags; - keg->uk_allocf = page_alloc; - keg->uk_freef = page_free; keg->uk_slabzone = NULL; /* @@ -1426,20 +1424,20 @@ keg_ctor(void *mem, int size, void *udata, int flags) * If we haven't booted yet we need allocations to go through the * startup cache until the vm is ready. */ - if (keg->uk_ppera == 1) { + if (booted < UMA_STARTUP2) + keg->uk_allocf = startup_alloc; #ifdef UMA_MD_SMALL_ALLOC + else if (keg->uk_ppera == 1) keg->uk_allocf = uma_small_alloc; +#endif + else + keg->uk_allocf = page_alloc; +#ifdef UMA_MD_SMALL_ALLOC + if (keg->uk_ppera == 1) keg->uk_freef = uma_small_free; - - if (booted < UMA_STARTUP) - keg->uk_allocf = startup_alloc; -#else - if (booted < UMA_STARTUP2) - keg->uk_allocf = startup_alloc; + else #endif - } else if (booted < UMA_STARTUP2 && - (keg->uk_flags & UMA_ZFLAG_INTERNAL)) - keg->uk_allocf = startup_alloc; + keg->uk_freef = page_free; /* * Initialize keg's lock