svn commit: r319724 - head/sys/vm

Gleb Smirnoff glebius at FreeBSD.org
Thu Jun 8 21:33:21 UTC 2017


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


More information about the svn-src-head mailing list