From nobody Fri Jan 21 02:27:09 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8F6D7196941A; Fri, 21 Jan 2022 02:27:18 +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 4Jg3Df5LLyz4p4R; Fri, 21 Jan 2022 02:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642732036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JQ+CuH0AKqCOtwliJXiIgz/uvJlMGZU10Quwdx4MYdg=; b=GffTxs4qlfQxXvLX8FDbMouaTMzAXuEoveeVLi8ZWLRkWzJGPtYldMHJMsY1K8gzxbRY+2 M4h+9rScvwWSvPGNt9i5gqiNUtdf8f7Ir98Bu6V/K9O+zNVW8mSxRPbBuUapLCsgrC1qYv va9NVsoN3fiwglxxQd1sxV9hPh6mC9AbbNKVgrA/0BxNdzBAvRJkJzu87tqO84th1U1cfv i6dOE8erYdwz48bqNtnCVhrKpIUvyFbESk8nr5ToNxuPDkT95gVolJ2iDUzYNQqrsiNmG5 q5oDSgVrTLObboDWAEf3xi+bFtSx0m5zqQwJVPC6x9v7d7KGuhJnqLUPIfjiTA== 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 D05D713A69; Fri, 21 Jan 2022 02:27:09 +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 20L2R9ov001612; Fri, 21 Jan 2022 02:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20L2R9ZQ001611; Fri, 21 Jan 2022 02:27:09 GMT (envelope-from git) Date: Fri, 21 Jan 2022 02:27:09 GMT Message-Id: <202201210227.20L2R9ZQ001611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: fb56e14ce64e - stable/13 - nvme: Do not rearm timeout for commands without one. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fb56e14ce64e3fc4703413c21d67c89df72fd9c5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642732036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JQ+CuH0AKqCOtwliJXiIgz/uvJlMGZU10Quwdx4MYdg=; b=NxC3fsa8MyUsJcolB+3yo74H4C8GUaNc+Bx5shisF8CqikkZNM1koXGRJG1R2p3l1MNikX 2CD644nhKM6cemFTgNljqPOKKV8tfYNoBBEM/PDibfLNw9hIyXOt6Vbjh1oz2JICgyWQv+ d1FcA+wATHQMigB0MijqVHtmQZMqCRXHD+I5qjrTtOgMAwG5ybzYE1RF3WDmeMOHmnToIA ovvNjqEVdIUpT29i434LrgYUjTvqg3QcVKwAvOeAqr4OVzhZaKwy9NJSmKVDg1wnCwNm1n JbmxYjvhDZ72VguJrVNiev7meyAqYnJctkSAmtB397QG6CaZYCIqPlLevUZa/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642732036; a=rsa-sha256; cv=none; b=utRhKaJJWqNM+PQPuvyklZNhtvpOAcRPhtgKkKa5PUU9CJO+fW7uPxqeuK/606vCVKNaSK IknHIM4ut/3pSZqjyewnhCKAMDcfba/ajz0wTcOFnrxQtRzqwGfi/yN/FWvrFADLQHSc3c zNFgbS7HZ6C5igfBq/yey6oB21Nr8pEu1lNVbzN4k5vSiCEZzi24gnkvSRnJNY8JwRDV/3 RnPpxDDU/DEus2s2NBe2TLZ3I/xht7azheAxDx6+0boRk1nDy+hkZ/3tNnplKcVMFUaBEc iCgkp5CZv72Nsu6GpBAkWaqidPf1ElFwqlkLBMYEgdN04zqRbyWIsS/iicM6Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=fb56e14ce64e3fc4703413c21d67c89df72fd9c5 commit fb56e14ce64e3fc4703413c21d67c89df72fd9c5 Author: Alexander Motin AuthorDate: 2022-01-07 17:54:49 +0000 Commit: Alexander Motin CommitDate: 2022-01-21 02:07:31 +0000 nvme: Do not rearm timeout for commands without one. Admin queues almost always have several ASYNC_EVENT_REQUEST outstanding. They have no timeouts, but their presence in qpair->outstanding_tr caused useless timeout callout rearming twice a second. While there, relax timeout callout period from 0.5s to 0.5-1s to improve aggregation. Command timeouts are measured in seconds, so we don't need to be precise here. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D33781 (cherry picked from commit b3c9b6060f9a3525196867d8e812b24fc0bc61e1) --- sys/dev/nvme/nvme_qpair.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 54718492ff09..0bf485cea47f 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -948,7 +948,6 @@ nvme_qpair_timeout(void *arg) struct nvme_qpair *qpair = arg; struct nvme_controller *ctrlr = qpair->ctrlr; struct nvme_tracker *tr; - struct nvme_tracker *tr_temp; sbintime_t now; bool idle; uint32_t csts; @@ -962,8 +961,12 @@ again: if (idle) break; now = getsbinuptime(); - TAILQ_FOREACH_SAFE(tr, &qpair->outstanding_tr, tailq, tr_temp) { - if (now > tr->deadline && tr->deadline != 0) { + idle = true; + TAILQ_FOREACH(tr, &qpair->outstanding_tr, tailq) { + if (tr->deadline == SBT_MAX) + continue; + idle = false; + if (now > tr->deadline) { /* * We're now passed our earliest deadline. We * need to do expensive things to cope, but next @@ -1028,7 +1031,7 @@ again: * Rearm the timeout. */ if (!idle) { - callout_schedule(&qpair->timer, hz / 2); + callout_schedule_sbt(&qpair->timer, SBT_1S / 2, SBT_1S / 2, 0); } else { qpair->timer_armed = false; } @@ -1061,8 +1064,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr) tr->deadline = getsbinuptime() + timeout * SBT_1S; if (!qpair->timer_armed) { qpair->timer_armed = true; - callout_reset_on(&qpair->timer, hz / 2, - nvme_qpair_timeout, qpair, qpair->cpu); + callout_reset_sbt_on(&qpair->timer, SBT_1S / 2, SBT_1S / 2, + nvme_qpair_timeout, qpair, qpair->cpu, 0); } } else tr->deadline = SBT_MAX;