From nobody Tue Oct 18 06:03:07 2022 X-Original-To: dev-commits-src-all@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 4Ms3F83FqGz4g86T; Tue, 18 Oct 2022 06:03:08 +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 4Ms3F76KGvz3bkl; Tue, 18 Oct 2022 06:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666072987; 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=Fw+ZMt1wmD5dqe/5F0JgZcD+fw0cz5arJ/HBYJoKE3g=; b=ygsxhok1/DF6yPCMg5lR7w0Ee3rAawetEusnXQaV38Clp8PZq+HRmXPBnnWOSrhUmSdTS6 xl07I9sQLbplQGH9ZDF0JLipE/0MfUE8NWBl/ag6SG0QbuHclR+XDrTU6b2VSbJh8jdk/Y GtyNTuHJ01RS453pI/qy+NtKKhF4EQ/yCYrVtgly6VN0PXzqCyzUy9pjW3+MroOsiRVozm 8RfPzT2e2CaVHFNsGqznNHbMPbU3sbdKKzvAJ8jr7BfUYMlCzW3doca4avf1F2+IEnqQPT 5BtlaJDSA/FNhATsSCH9e6qw+HLubokWDqygqMZs8W2QOrC31RaYuhk+BaN5Rw== 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 4Ms3F75N3zz15BM; Tue, 18 Oct 2022 06:03:07 +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 29I637cx097334; Tue, 18 Oct 2022 06:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29I637Qc097333; Tue, 18 Oct 2022 06:03:07 GMT (envelope-from git) Date: Tue, 18 Oct 2022 06:03:07 GMT Message-Id: <202210180603.29I637Qc097333@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: cc25cfc9cf8a - main - vtblk: Requeue inside vtblk_request_execute List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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: cc25cfc9cf8a3d21d4f989eca9a4d1060d5d488e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666072987; 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=Fw+ZMt1wmD5dqe/5F0JgZcD+fw0cz5arJ/HBYJoKE3g=; b=bYwlvdXNd7pCwb6wUkAAGL9BQANdfdascx7hjyafGtKIxpHHmRX4a4BNJ0sU8ol5Ly0OKW wzj2aYGr+iPvZCiO4xi7f4ejbVpR+9ItFwP4E89CKSPzGzn+97+gtx7+NY6Rv9ZgGLoox1 ZDd6teLu05cNskKtyp8cDQ0jxLFfDi/762fQvX19y4fD5Izh5LH5GdetYwlgjl9BXHpMDL WXn3sTWGaB/mFLy2DfKXV2LUNUgZy6h6c2oDuWruH4jLgSAkwOaMZlbQSkq62Viou+iETN jffrpW4MSlXmeksI96gLQugCXsd6c428KhiDbKRdGBCBuvoprxZ5SQpdeVkrFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666072987; a=rsa-sha256; cv=none; b=NQB7yfNqHXh5Z3hv2nWaVVcGS8kZtZzqPobF5QsPCsCTzHJ/8Qsil9PD+yFjMXnzedcsgt R43aPgCwCwKIjMsZ+S2ohRF4Gz2y2g/0lLt5bsZXX+X3dN8F+Z0mTZQxBdBuA3EF/g8lqC nQbJuflX3yPoPcFi0W96aSfvHclnIdfMR8eHaxSEw31HFE7w/feD4D1hIAuzfQt/C2TSgI cvg+ujc+2Pt3rUaGFNs8bOdBuXr7qYpr/21qzwyRYzCUaRmYHyheal2N3Vw49j7x4cXEoU Rts8AtgNpLVDOEjzlTUIrWBWnKKNfhBejrxOj2gv91dYFjvqRpFtNTpuZSbeHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cc25cfc9cf8a3d21d4f989eca9a4d1060d5d488e commit cc25cfc9cf8a3d21d4f989eca9a4d1060d5d488e Author: Colin Percival AuthorDate: 2022-09-18 16:16:30 +0000 Commit: Colin Percival CommitDate: 2022-10-18 06:02:21 +0000 vtblk: Requeue inside vtblk_request_execute Most virtio_blk requests are launched from vtblk_startio; prior to this commit, if vtblk_request_execute failed (e.g. due to a lack of space on the virtio queue) vtblk_startio would requeue the request to be reattempted later. Add a flag "vbr_requeue_on_error" to requests and perform the requeuing from inside vtblk_request_execute instead. No functional change intended. Reviewed by: bryanv, imp Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D36665 --- sys/dev/virtio/block/virtio_blk.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c index 8d39d80a8c91..fca2d367c170 100644 --- a/sys/dev/virtio/block/virtio_blk.c +++ b/sys/dev/virtio/block/virtio_blk.c @@ -62,6 +62,7 @@ struct vtblk_request { struct virtio_blk_outhdr vbr_hdr; struct bio *vbr_bp; uint8_t vbr_ack; + uint8_t vbr_requeue_on_error; int vbr_error; TAILQ_ENTRY(vtblk_request) vbr_link; }; @@ -1008,6 +1009,8 @@ vtblk_request_execute(struct vtblk_softc *sc, struct vtblk_request *req) sc->vtblk_req_ordered = req; out: + if (error && req->vbr_requeue_on_error) + vtblk_request_requeue_ready(sc, req); req->vbr_error = error; } @@ -1133,11 +1136,10 @@ vtblk_startio(struct vtblk_softc *sc) if (req == NULL) break; + req->vbr_requeue_on_error = 1; vtblk_request_execute(sc, req); - if (req->vbr_error != 0) { - vtblk_request_requeue_ready(sc, req); + if (req->vbr_error != 0) break; - } enq++; }