From nobody Tue Oct 06 22:58:51 2026 X-Original-To: dev-commits-src-main@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 4hzsBM3dxTz6cf1v for ; Tue, 06 Oct 2026 22:58:51 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hzsBM1XbYz3DGy for ; Tue, 06 Oct 2026 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791327531; 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=oi8Q4nIwWN/G4eVRD90+ILBxPOoz563F1RBX7yQPCVE=; b=uR2uWrgPumzwRZELKvZ1nDnXtw7o02v9H0htcA1SrZSAKTkIAQlEke1D/7NRmqBeZf/xKQ ltMdHoP154cp5wgLbG147aQpCdNOUWIr5NvVrm9ehIp+PE25lWsYNNjT5omBfhxQs0kWJp fneY+/yy+PzDBO1Y9hzGgoy9VftDn2gpjgy36kb3iozKykvmvQ7oSX2Skp4Z12iq4ZT3Ur Vom4gtcwbfrueLniUAGZqOnHFS2FvvzhjBQnjSVBt+jWY21t9iLtUCQhnG5tSPVtueY8KO L0nh47YC0L95LSqZSrxEMBKWZj00iIiCquNDVWjhDwmfYRhwIYWQq54D4dZBUA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791327531; b=v9g71DAd7ki573iB6X1ulejgPKgh8U5iybubrKuyrMzueLbJxd1aXJMyAUuCywy6z1VP1H K6dL8qC0Zl7RBgoh6n+jpuyWopGlcF9JK64cd+SIT6qN98UUFZad6e5wcJ+i6O154vTD4n B2kVbdH6ip2N5gIZK6AZFA4In7oI/tJMDV/8YCw5PrNlA4WaWUINv8Q9QcnecZ4jvwMtI5 m00LujC3yls4SfHCwqK58oaW7Hzrtj+c4HKnHGdf9Qxn7dW5WTs2Amttr6D6AlzLLwmOB7 4yT7bd3kZuhDz8In8XEDhfMICtGz3Q9vff/kRoCao75/+EiShfqEKjYf7lZ4zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791327531; 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=oi8Q4nIwWN/G4eVRD90+ILBxPOoz563F1RBX7yQPCVE=; b=v4BjRm713s/UFZ9n6zmNdthPLgg5LvZ2PgWnXHV5S6OXPa/pGtsyFmmHIMf3HzCW/5n224 zBaboTcMPBpoR6+JI1aUlDb44EdbHMvbxBP8onsSbI2UNb2KC2Gy5xNNQg3ssjF3oLbf1G Tk2m5k6ZTZ5hqfwgfq6L0E/4liTVOA6d0pwVb8fklBO+BGRG/uvcOMo+4niA0byF3ep/qa LgQvusYR3/CcVWfH0bThFdrAcUB1pBoaTFnLGwzdVBfoAPhpL4gpNbhACF4I7MTgNBlUnn Kj88O3QFnLzUCcHUrziMr+eCEEFvmbSTvDaMMO3mUJCWMuTI4E2cVITwikNUXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hzsBM06LMzQvk for ; Tue, 06 Oct 2026 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32359 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 06 Oct 2026 22:58:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bd86f0508e46 - main - da: Update trim stats with the periph lock held List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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/main X-Git-Reftype: branch X-Git-Commit: bd86f0508e461526ba7342e52bd9778394b183f7 Auto-Submitted: auto-generated Date: Tue, 06 Oct 2026 22:58:51 +0000 Message-Id: <6ac57d2b.32359.3662596e@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bd86f0508e461526ba7342e52bd9778394b183f7 commit bd86f0508e461526ba7342e52bd9778394b183f7 Author: Warner Losh AuthorDate: 2026-10-06 22:45:46 +0000 Commit: Warner Losh CommitDate: 2026-10-06 22:46:23 +0000 da: Update trim stats with the periph lock held Separate the updating the stats for the completion from the biodone for each one. Sponsored by: Netflix Reviewed by: ali_mashtizadeh.com Differential Revision: https://reviews.freebsd.org/D60156 --- sys/cam/scsi/scsi_da.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 04f924c7a91e..ee5066592f1a 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -4658,6 +4658,7 @@ static void dadone(struct cam_periph *periph, union ccb *done_ccb) { struct bio *bp, *bp1; + struct bio_queue queue; struct da_softc *softc; struct ccb_scsiio *csio; da_ccb_state state; @@ -4788,16 +4789,21 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * the case of sendfile can be quite extensive. Release the periph * refcount taken in dastart() for each CCB. */ - cam_iosched_bio_update_stats(softc->cam_iosched, bp, done_ccb); + if (state == DA_CCB_DELETE) { + TAILQ_INIT(&queue); + TAILQ_INSERT_HEAD(&queue, bp, bio_queue); + TAILQ_CONCAT(&queue, &softc->delete_run_queue.queue, + bio_queue); + softc->delete_run_queue.insert_point = NULL; + cam_iosched_bio_queue_update_stats(softc->cam_iosched, &queue, + done_ccb, bp->bio_error); + } else { + cam_iosched_bio_update_stats(softc->cam_iosched, bp, done_ccb); + } xpt_release_ccb(done_ccb); KASSERT(softc->refcount >= 1, ("dadone softc %p refcount %d", softc, softc->refcount)); softc->refcount--; if (state == DA_CCB_DELETE) { - TAILQ_HEAD(, bio) queue; - - TAILQ_INIT(&queue); - TAILQ_CONCAT(&queue, &softc->delete_run_queue.queue, bio_queue); - softc->delete_run_queue.insert_point = NULL; /* * Normally, the xpt_release_ccb() above would make sure * that when we have more work to do, that work would @@ -4813,20 +4819,14 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) cam_periph_unlock(periph); while ((bp1 = TAILQ_FIRST(&queue)) != NULL) { TAILQ_REMOVE(&queue, bp1, bio_queue); - bp1->bio_error = bp->bio_error; - if (bp->bio_flags & BIO_ERROR) { - bp1->bio_flags |= BIO_ERROR; - bp1->bio_resid = bp1->bio_bcount; - } else - bp1->bio_resid = 0; biodone(bp1); } } else { daschedule(periph); cam_periph_unlock(periph); + if (bp != NULL) + biodone(bp); } - if (bp != NULL) - biodone(bp); return; }