From nobody Wed Nov 18 18:03:10 2026 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 4jV8bL4X7Rz70xy9 for ; Wed, 18 Nov 2026 18:03:10 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jV8bL0Ypwz4k5m for ; Wed, 18 Nov 2026 18:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795024990; 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=NzXQ2ebl09JK0g5JVmUDHFPUjYsCIgKzq94hP+WMEqg=; b=cOuHG+JIJzGNL6kolwuwB+o4ODgzx0nc2NBFARMHTsvmlQGw+W1vn4IwkQFQqSeI7w2IaN FdMOULCF4PaoH1f+CwhmnRAFYW1ByFpZgAUnzvetb5jNvyOlkDQZiM3mPUKe9bZIEtrcBg MAA9bDZ82jPhC2Lo56dQqH/idHga0WoxsCyE/MVA1Zia57TQU9iV9xQMi7VyOmw7S9QwdU n/dRFynyYXddTUCMh1S61sOmGGupHWV9WQg2MRZL+SuFPtCPfrS2E72tPTvfyJPG0g77jn fMogsre5SvDXfYe5c8ydT8mxO2uxkdS4Ca32wve2enAf36hh5FCcvlZdStWJNg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795024990; b=FcAH1eWmakFkPUNq99D3O6FhR0bF4qy6YCLl5KwzK5z9rbRfrJS7Za6EseW6+KyvjwMk5P MGvcavktXCmP/atSUwMtJKsMCnJEfiKUje9h8SlrTVwyiWxF3W2wXkQlJgPugZQuvuXEgV pAeOds62kYom8X14lD79uIot+bGXnNxdsgQDBTuEv1VAaTE15EvRJbFYljiGvjTs3SSfCL L+pzk7/L/i0qrzDRGga2OM5tVgkO9ZKMAJ9BVp0xNAqglziQ4jg23UsJmbPRZEb5BIRh7v ODEXFZoVqtvKXLy5IWvZH/7nFZhzjD9bxPS0YO0BfCIsmvEUHpBb5AzWn7XbMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795024990; 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=NzXQ2ebl09JK0g5JVmUDHFPUjYsCIgKzq94hP+WMEqg=; b=cuECAaNhsb/SzCIkJjpVVH+r8y2b8RTM7bvTqB24z1lbpKvoOxmeBC4WrlhOZdsjb0G8jx 6+lu27hVHVK+u5Tg9MzEqHyB+lt/xIS3YbLeWx+Eln3j7NY/8BxC3v8hYs/hlN5SPMoDQq G8d+888mrgyRoKRFzeYBz9hhWeM24HtIn7eUrefXkTJXFscAoNCaG1jyoDORh36Hep9w4p aOmSDIu9m1kLyqc5zsm0IEb8+O3cub15oay3Iq8XXLBoW7JmF1NWbVJLwFXq1Zi4rxiMz0 gxE0B2mGRzXD3ep9GzVXdjdg323rtMObCt0rOz376jtOmnT6AhNTbpRQcxcizw== 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 4jV8bL04b7zNTy for ; Wed, 18 Nov 2026 18:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id cec9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Nov 2026 18:03:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kenneth D. Merry Subject: git: a4abe5fe9a7d - stable/15 - pass(4): Wake select/kqueue waiters when an immediate CCB completes List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: a4abe5fe9a7deced628590bfc66c310713a02f21 Auto-Submitted: auto-generated Date: Wed, 18 Nov 2026 18:03:10 +0000 Message-Id: <6afde85e.cec9.7375940c@gitrepo.freebsd.org> The branch stable/15 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=a4abe5fe9a7deced628590bfc66c310713a02f21 commit a4abe5fe9a7deced628590bfc66c310713a02f21 Author: Kenneth D. Merry AuthorDate: 2026-11-10 23:01:38 +0000 Commit: Kenneth D. Merry CommitDate: 2026-11-18 17:37:08 +0000 pass(4): Wake select/kqueue waiters when an immediate CCB completes In the CAMIOQUEUE ioctl, a queued CCB completes through passdone(), which moves it to the done queue and calls selwakeuppri() and KNOTE_LOCKED() so that a consumer blocked in select(2), poll(2) or kevent(2) wakes up and collects the CCB with CAMIOGET. An immediate CCB (e.g. XPT_DEV_ADVINFO or XPT_DEV_MATCH) is instead executed synchronously in the ioctl and moved to the done queue directly, with no notification, so a consumer sleeping while waiting for its completion never wakes up until some other queued I/O completes. Send the same notification that passdone() sends. The peripheral lock is held at this point and backs the knlist, so KNOTE_LOCKED() is the correct variant. A version of this fix has been in production use at Spectra Logic since 2024. Co-authored-by: Dave Baukus Reviewed by: imp MFC after: 1 week Sponsored by: Spectra Logic Assisted-by: Claude Fable 5 Differential Revision: https://reviews.freebsd.org/D61416 (cherry picked from commit 6442a92a7d9c20c666999cc699610f1f5bec3cfd) --- sys/cam/scsi/scsi_pass.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c index b44ab866dfe7..8164edd243fd 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -2004,11 +2004,14 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread /* * If this is not a queued CCB (i.e. it is an immediate CCB), * then it is already done. We need to put it on the done - * queue for the user to fetch. + * queue for the user to fetch, and notify any waiters so + * they know there is a completed CCB to collect. */ if ((fc & XPT_FC_QUEUED) == 0) { TAILQ_REMOVE(&softc->active_queue, io_req, links); TAILQ_INSERT_TAIL(&softc->done_queue, io_req, links); + selwakeuppri(&softc->read_select, PRIBIO); + KNOTE_LOCKED(&softc->read_select.si_note, 0); } break;