From owner-dev-commits-src-main@freebsd.org Sun Sep 5 19:51:50 2021 Return-Path: Delivered-To: dev-commits-src-main@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 B01696608F0; Sun, 5 Sep 2021 19:51:50 +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 4H2hxf3lMhz4SVv; Sun, 5 Sep 2021 19:51:50 +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 5058611666; Sun, 5 Sep 2021 19:51:50 +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 185Jpojv056901; Sun, 5 Sep 2021 19:51:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 185Jpo57056900; Sun, 5 Sep 2021 19:51:50 GMT (envelope-from git) Date: Sun, 5 Sep 2021 19:51:50 GMT Message-Id: <202109051951.185Jpo57056900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: bad42df9bfcb - main - Add some nvme initialization routines to TSLOG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad42df9bfcb8d77bdec04ea1f9acd874c762740 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2021 19:51:50 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=bad42df9bfcb8d77bdec04ea1f9acd874c762740 commit bad42df9bfcb8d77bdec04ea1f9acd874c762740 Author: Colin Percival AuthorDate: 2021-09-05 19:48:43 +0000 Commit: Colin Percival CommitDate: 2021-09-05 19:48:43 +0000 Add some nvme initialization routines to TSLOG About 335 ms of EC2 instance boot time is being spent here. --- sys/dev/nvme/nvme_ctrlr.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 52eab6254d89..833bf328584a 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -407,6 +407,7 @@ nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) { int err; + TSENTER(); nvme_ctrlr_disable_qpairs(ctrlr); pause("nvmehwreset", hz / 10); @@ -414,7 +415,9 @@ nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) err = nvme_ctrlr_disable(ctrlr); if (err != 0) return err; - return (nvme_ctrlr_enable(ctrlr)); + err = nvme_ctrlr_enable(ctrlr); + TSEXIT(); + return (err); } void @@ -1045,6 +1048,8 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting) uint32_t old_num_io_queues; int i; + TSENTER(); + /* * Only reset adminq here when we are restarting the * controller after a reset. During initialization, @@ -1117,6 +1122,7 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting) for (i = 0; i < ctrlr->num_io_queues; i++) nvme_io_qpair_enable(&ctrlr->ioq[i]); + TSEXIT(); } void @@ -1124,6 +1130,8 @@ nvme_ctrlr_start_config_hook(void *arg) { struct nvme_controller *ctrlr = arg; + TSENTER(); + /* * Reset controller twice to ensure we do a transition from cc.en==1 to * cc.en==0. This is because we don't really know what status the @@ -1155,6 +1163,7 @@ fail: ctrlr->is_initialized = 1; nvme_notify_new_controller(ctrlr); + TSEXIT(); } static void