From nobody Wed May 20 00:33:35 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 4gKswH5x6wz6dprZ for ; Wed, 20 May 2026 00:33:35 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gKswH5KBTz4Hfh for ; Wed, 20 May 2026 00:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779237215; 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=QdoyVYjWKYqdfe6XJP4kKVKuN+3C9Qn8VmNhFSB9UsY=; b=w0P68RLdYF6JmeAtAXzLnKv57yUBRak+bB0lOCsWjg5b1jzwCB0dKLWPg1PlKmtPZPlL0j 6JWqfr/pI4HyN4OvTqvyWB7B2a7H4ki8s7RBEBLOnAbKIqSmPmIA8GWMbDHhYL/xItM669 W0ddT3YOFGX/nXBz2npbNSWedTmwX4mz2Ib11eUG7ISoxWA9aZ0CrG6KXwUI5ar2fMOLJt lqw3AHUHBimFgeUJBjUU6PDpeg1d9CksdN4JUJOMLvGoX+6TzsXvI3LxcAEaEMH6YYASKu aD/CZdLxJk+YG3tKtn2JHLX7jObO3JMtBzP7Ejd3d1Xq8nmb9iyQOy9m3FR8gQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779237215; a=rsa-sha256; cv=none; b=veyHVLDiaz8cgWd0UEqLlCqjfZIJn1L6SqcMB+0Y3of0dJMibyuIGbVMNKUu+2/lKEbWkf FD4b7YANTRDOtPLwuA0NDDTwS5i5vguzWHeYX3xycCv+sHLZC2j9DUIeWZpfGyCHKmkUe+ LoPbCVBMhGkBcukd3FA3/+KSj8NM0uRhtoTHYTdb2EKEq/071949pIgiH5TR7m7KwJUpuL VtAzRRBqpHPBeZCYNuYiIZfyxat8w+ss3sC5aSrpDmZcggO6Xm294ZVp6wjs+9HXW6gJqU edLqabrHTMO6oGB25hHgQYnYcempWoHnA3thVZYc0dSO1ZI8f/PGXEbyn6hJvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779237215; 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=QdoyVYjWKYqdfe6XJP4kKVKuN+3C9Qn8VmNhFSB9UsY=; b=KJsGLWPQxfoFXAmOtVAuhJedkrCRPXH/EnBj6WF7AmkUKq5gYt6j/qQr2gYaRQI1U7TDcm MEYz7+Ovz+ZaemcebOAbOj94Qe3b09+lU5TaQpygfETld8Qnb3IHQ+iVYUT0o00bMKHE7d oGR/7WA4azSobYkKi9JQBILCVgEUdoGcHu9Wz1sMqEAejIIS7yOUZ++xTdje5oZOHM2PGi 0NEPruZWQvgo++Qf28tFgJ4Sion0GheX0plseFH+jEMf0908UxLFWvpdfN3UV8B5FjEJop cBvdEsLt7tKSG0KhtZkrLgmI3vU+uOCyW48v3OMkvESDYKc1Be1G4YAmu5iJxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gKswH4swFzfHr for ; Wed, 20 May 2026 00:33:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 268a7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 20 May 2026 00:33:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e6623a912911 - stable/15 - locking.9: warn about using sleepable lock address as a sleep channel 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e6623a91291117c498113f63cc0053c8a459cf27 Auto-Submitted: auto-generated Date: Wed, 20 May 2026 00:33:35 +0000 Message-Id: <6a0d015f.268a7.747ff700@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e6623a91291117c498113f63cc0053c8a459cf27 commit e6623a91291117c498113f63cc0053c8a459cf27 Author: Konstantin Belousov AuthorDate: 2026-05-15 11:05:45 +0000 Commit: Konstantin Belousov CommitDate: 2026-05-20 00:33:08 +0000 locking.9: warn about using sleepable lock address as a sleep channel (cherry picked from commit 56bc43f5d02bd0745d597db44c285bf78d083762) --- share/man/man9/locking.9 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/share/man/man9/locking.9 b/share/man/man9/locking.9 index ad044b6e1d46..9afdcd56f4f6 100644 --- a/share/man/man9/locking.9 +++ b/share/man/man9/locking.9 @@ -205,11 +205,6 @@ The functions and .Fn wakeup_one also handle event-based thread blocking. -Unlike condition variables, -arbitrary addresses may be used as wait channels and a dedicated -structure does not need to be allocated. -However, care must be taken to ensure that wait channel addresses are -unique to an event. If a thread must wait for an external event, it is put to sleep by .Fn tsleep , .Fn msleep , @@ -222,6 +217,16 @@ Threads may also wait using one of the locking primitive sleep routines or .Xr sx_sleep 9 . .Pp +Unlike condition variables, +arbitrary addresses may be used as wait channels and a dedicated +structure does not need to be allocated. +However, care must be taken to ensure that wait channel addresses are +unique to an event. +For example, the memory address of a sleepable lock such as a +.Xr sx 9 +must not be used as a sleep channel, because the lock implementation +will internally use the same address as a wait channel. +.Pp The parameter .Fa chan is an arbitrary address that uniquely identifies the event on which