From nobody Wed Nov 11 13:59:29 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 4jPlWP51cKz70FRp for ; Wed, 11 Nov 2026 13:59:29 +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 4jPlWP3vv1z4HpF for ; Wed, 11 Nov 2026 13:59:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794405569; 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=ultCB5kiwxzRAdJLIavUytm+ORNgUb1xVjSRaPXIVOU=; b=EJvAWhXnMhlpgip8a+Msazcsl5sd3NM3OVXtBSANJ6DsMNFZ1ZO+r83Vw9tdKD+klM4lOo tBQoSuWnuAdb4Be7LhA3dvbTQv7pI5fYN9w0GDDTppVhULw6FHkqvmqM+OcKXTMw8haAyj nRVFNwvc7C7N5dkrw7IwFMPb35k6U/AhCco+JmPVMhqTDjoGAeJ40V+960+sLF2cx6e3F+ Ud61nSGGN0Yp2RWE3v5IM4Cn1x5WFmGNOHk7A4e92UTdoXGxyFQvIeecFn7vFrkuMaG7oe 0aj0vmVj15Whz8uNZfZUxwiZOCAuKVMTfS0M5ZNa4mFTbaOWlZSENDcvfHBjZA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794405569; b=hQYkk9GCa0rfpHHrMCtlnlyJ0LJTIwqb6LKKJH1T0a/86+5jqDLzsW3ZJy9tWkkX0Dk4Mv 5CTNzG6eVtpoJntnl9jd1tj47433Ta49PV+iN9CwfVDGY1BbISIlxfNsJyVKtQe45TsM7/ eJ7ggN7q7Q6eWcwrJR8f9arOjPX10zO7q9RH5T5r3IC6+PcGaUayHT/E596plT+6JXaLJB YgMczq7o4d3GjQ0ngN7d2OglREi4Cgst62oGy/plq2EQR7sK2pDusmrQU9SKCpThILkoWK whdLT4v4rKOkw1UztZJvJ3lmdQVUwCrs9dJNK4T21XWT/1G22i4BwnWMlSSEHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794405569; 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=ultCB5kiwxzRAdJLIavUytm+ORNgUb1xVjSRaPXIVOU=; b=bHU9nz8tkPX9YHLhQe62SH9YDHzmjzZn4CVzMulqfjsKFiW5xU7U4en0kSq3K0REw20qGD imo+RKxNGHezJDDdb8mUzVwyUZ7SxroHPrM4ofFq570XPsrkBOnOmpTXu+8ZxV8w+DdhTd nxENUwCzMDyUPzw/AwBYIEjVxWNsp5YmK6KFEZEwcridRScpfUpkfRF+vZNEv/LYG/uOHi gPq/If9nbOVbpXuKpJhg2xAIoxOkI/ALSaMerCo+Ry4qqQkhol3uWg5XFEtTBchvndRsFS hu5FLq663DWhtKMv6sYHkqxjMq/hgmibJVvDkgJrcbzfdNYxb2HJosYTK/Iw8w== 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 4jPlWP361QzHQ7 for ; Wed, 11 Nov 2026 13:59:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id b418 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 11 Nov 2026 13:59:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kenneth D. Merry Subject: git: 6442a92a7d9c - main - 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/main X-Git-Reftype: branch X-Git-Commit: 6442a92a7d9c20c666999cc699610f1f5bec3cfd Auto-Submitted: auto-generated Date: Wed, 11 Nov 2026 13:59:29 +0000 Message-Id: <6af474c1.b418.64ddcd9d@gitrepo.freebsd.org> The branch main has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=6442a92a7d9c20c666999cc699610f1f5bec3cfd commit 6442a92a7d9c20c666999cc699610f1f5bec3cfd Author: Kenneth D. Merry AuthorDate: 2026-11-10 23:01:38 +0000 Commit: Kenneth D. Merry CommitDate: 2026-11-11 13:59:26 +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 --- 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 6b1045dadf20..6bb91e453e2b 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -2074,11 +2074,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;