Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2020 16:06:31 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368236 - head/sys/kern
Message-ID:  <202012011606.0B1G6V12069341@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Dec  1 16:06:31 2020
New Revision: 368236
URL: https://svnweb.freebsd.org/changeset/base/368236

Log:
  vmem: Revert r364744
  
  A pair of bugs are believed to have caused the hangs described in the
  commit log message for r364744:
  
  1. uma_reclaim() could trigger reclamation of the reserve of boundary
     tags used to avoid deadlock.  This was fixed by r366840.
  2. The loop in vmem_xalloc() would in some cases try to allocate more
     boundary tags than the expected upper bound of BT_MAXALLOC.  The
     reserve is sized based on the value BT_MAXMALLOC, so this behaviour
     could deplete the reserve without guaranteeing a successful
     allocation, resulting in a hang.  This was fixed by r366838.
  
  PR:		248008
  Tested by:	rmacklem

Modified:
  head/sys/kern/subr_vmem.c

Modified: head/sys/kern/subr_vmem.c
==============================================================================
--- head/sys/kern/subr_vmem.c	Tue Dec  1 16:02:52 2020	(r368235)
+++ head/sys/kern/subr_vmem.c	Tue Dec  1 16:06:31 2020	(r368236)
@@ -706,14 +706,10 @@ vmem_startup(void)
 	vmem_zone = uma_zcreate("vmem",
 	    sizeof(struct vmem), NULL, NULL, NULL, NULL,
 	    UMA_ALIGN_PTR, 0);
-#ifdef UMA_MD_SMALL_ALLOC
 	vmem_bt_zone = uma_zcreate("vmem btag",
 	    sizeof(struct vmem_btag), NULL, NULL, NULL, NULL,
 	    UMA_ALIGN_PTR, UMA_ZONE_VM);
-#else
-	vmem_bt_zone = uma_zcreate("vmem btag",
-	    sizeof(struct vmem_btag), NULL, NULL, NULL, NULL,
-	    UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
+#ifndef UMA_MD_SMALL_ALLOC
 	mtx_init(&vmem_bt_lock, "btag lock", NULL, MTX_DEF);
 	uma_prealloc(vmem_bt_zone, BT_MAXALLOC);
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012011606.0B1G6V12069341>