From owner-dev-commits-src-branches@freebsd.org  Sat Jul 31 00:21:26 2021
Return-Path: <owner-dev-commits-src-branches@freebsd.org>
Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04E30651410;
 Sat, 31 Jul 2021 00:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4Gc4gm6Lqkz4VtG;
 Sat, 31 Jul 2021 00:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org)
Received: from gitrepo.freebsd.org (gitrepo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:5])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C3AC6BAC;
 Sat, 31 Jul 2021 00:21:24 +0000 (UTC) (envelope-from git@FreeBSD.org)
Received: from gitrepo.freebsd.org ([127.0.1.44])
 by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16V0LOCE051409;
 Sat, 31 Jul 2021 00:21:24 GMT (envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
 by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16V0LOem051400;
 Sat, 31 Jul 2021 00:21:24 GMT (envelope-from git)
Date: Sat, 31 Jul 2021 00:21:24 GMT
Message-Id: <202107310021.16V0LOem051400@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
 dev-commits-src-branches@FreeBSD.org
From: Warner Losh <imp@FreeBSD.org>
Subject: git: f502f8abe08b - stable/12 - nvme: change namei_request_zone into
 a malloc type
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Git-Committer: imp
X-Git-Repository: src
X-Git-Refname: refs/heads/stable/12
X-Git-Reftype: branch
X-Git-Commit: f502f8abe08b1b39ec3b53eeaadf7dfad8930574
Auto-Submitted: auto-generated
X-BeenThere: dev-commits-src-branches@freebsd.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: Commits to the stable branches of the FreeBSD src repository
 <dev-commits-src-branches.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/dev-commits-src-branches>, 
 <mailto:dev-commits-src-branches-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/dev-commits-src-branches/>
List-Post: <mailto:dev-commits-src-branches@freebsd.org>
List-Help: <mailto:dev-commits-src-branches-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/dev-commits-src-branches>, 
 <mailto:dev-commits-src-branches-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 31 Jul 2021 00:21:26 -0000

The branch stable/12 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=f502f8abe08b1b39ec3b53eeaadf7dfad8930574

commit f502f8abe08b1b39ec3b53eeaadf7dfad8930574
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2020-11-05 21:44:58 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-07-31 00:02:52 +0000

    nvme: change namei_request_zone into a malloc type
    
    Both the size (128 bytes) and ephemeral nature of allocations make it a great
    fit for malloc.
    
    A dedicated zone unnecessarily avoids sharing buckets with 128-byte objects.
    
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D27103
    
    (cherry picked from commit 71460dfcb275f0a2a20b39a332b0e1149c6e7e3f)
---
 sys/dev/nvme/nvme.c         | 5 -----
 sys/dev/nvme/nvme_private.h | 5 ++---
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/sys/dev/nvme/nvme.c b/sys/dev/nvme/nvme.c
index 843aa80bb4fb..8e5bc11b35d4 100644
--- a/sys/dev/nvme/nvme.c
+++ b/sys/dev/nvme/nvme.c
@@ -49,7 +49,6 @@ struct nvme_consumer {
 struct nvme_consumer nvme_consumer[NVME_MAX_CONSUMERS];
 #define	INVALID_CONSUMER_ID	0xFFFF
 
-uma_zone_t	nvme_request_zone;
 int32_t		nvme_retry_count;
 
 
@@ -62,9 +61,6 @@ nvme_init(void)
 {
 	uint32_t	i;
 
-	nvme_request_zone = uma_zcreate("nvme_request",
-	    sizeof(struct nvme_request), NULL, NULL, NULL, NULL, 0, 0);
-
 	for (i = 0; i < NVME_MAX_CONSUMERS; i++)
 		nvme_consumer[i].id = INVALID_CONSUMER_ID;
 }
@@ -74,7 +70,6 @@ SYSINIT(nvme_register, SI_SUB_DRIVERS, SI_ORDER_SECOND, nvme_init, NULL);
 static void
 nvme_uninit(void)
 {
-	uma_zdestroy(nvme_request_zone);
 }
 
 SYSUNINIT(nvme_unregister, SI_SUB_DRIVERS, SI_ORDER_SECOND, nvme_uninit, NULL);
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
index 2e2c383f455f..39b5af66501f 100644
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -104,7 +104,6 @@ MALLOC_DECLARE(M_NVME);
 #define CACHE_LINE_SIZE		(64)
 #endif
 
-extern uma_zone_t	nvme_request_zone;
 extern int32_t		nvme_retry_count;
 extern bool		nvme_verbose_cmd_dump;
 
@@ -488,7 +487,7 @@ _nvme_allocate_request(nvme_cb_fn_t cb_fn, void *cb_arg)
 {
 	struct nvme_request *req;
 
-	req = uma_zalloc(nvme_request_zone, M_NOWAIT | M_ZERO);
+	req = malloc(sizeof(*req), M_NVME, M_NOWAIT | M_ZERO);
 	if (req != NULL) {
 		req->cb_fn = cb_fn;
 		req->cb_arg = cb_arg;
@@ -550,7 +549,7 @@ nvme_allocate_request_ccb(union ccb *ccb, nvme_cb_fn_t cb_fn, void *cb_arg)
 	return (req);
 }
 
-#define nvme_free_request(req)	uma_zfree(nvme_request_zone, req)
+#define nvme_free_request(req)	free(req, M_NVME)
 
 void	nvme_notify_async_consumers(struct nvme_controller *ctrlr,
 				    const struct nvme_completion *async_cpl,