From nobody Sat Oct 04 02:23:11 2025 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 4cdq7z5Zlpz69qPH; Sat, 04 Oct 2025 02:23:11 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdq7z4sVHz3lp3; Sat, 04 Oct 2025 02:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759544591; 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=4Aexx652YRwNKKiKfAXrgI6U3wezGIMO6ja7R0o9fqQ=; b=gyBkOeULkw4PaybRg52Ch7dAa5U9gEBUR/KqjL3UIPiROHLSy/dAP6tH05cTsTqBKPtK7J goX7rtCtXaRUUSdNoan9FIa2ZElAqjp7TgeTflcAIy/mpjNhlnZbq6nuN7tFbM78mvY7Gl gdRbnzgZ8lXf98eWKZgCJcH4Rfqr4U5ysKt4scSX3KWtjtbF1pDVNMd1Akffdt5IMZhP0t DlHgXJLAWUX420JJ8gMkvztTmlvHTH77AqA06S4qnTlx3bqIvTrtsr53fcMOBkju1OeJ69 teD1/7K2+aHvAxXKa5gtH1bffGFx0LlXYB4XoCMoW8PJp7PB/XuTtcYXa8idgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759544591; 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=4Aexx652YRwNKKiKfAXrgI6U3wezGIMO6ja7R0o9fqQ=; b=lqNDeEJmbFZ4EPwwcaTsx/cF4gqtaKSzQJW7bWZ/Ubi30iJget7wVUXENCGAS2ORW7DSCz 531iFaxtnjdi5tNEqX+KB9MP6iBLK79GjH3pKlulklfVCpsFH8nCKXAUUrYyamBEC4OQ92 uDodFtZedUu5okl2tgSsUwe9E6hyAVJsh3bT4YFHxyRY0InUN6vojMS9RdHtG7lc6CL3hY UvSJUFzhKLHig+65FdOBN3n1oc7gGy0dpBHzz/tS2ynZeteM4M+95SYTtuy1UuXcBUOZgw 8/h0Dq9u8xTovsqVPtpauIu+oOEEgrNK9kDHjuZA5N3QpwXjTUlAub+cX2po4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759544591; a=rsa-sha256; cv=none; b=Sv+GN3+bNNpIGs42ewk+EOYYFujEXW3l8W1Wcj39FJOxAtUcNdhEskgXDDmRsdvgxMMw9g zDWioa8S6/ge0qDn18GgJWV36ePaNq0Z9zsrSKp+HhuYj5h03bLDEiaFfZQY/oUAVWh6p4 WiN4VcNkeKX7qNJdNvS3XbPNNSXq3r4U5Ayt8ilyWLem9t7TgCM1q2cgZTdB5J+VebaqiO 88BentoJed9ndmBS92mUXBlKaiouQWqwszddoH+Dkoht25ylpUCWqj9q9zeqEtHZE7Gzq9 SKvRv07/oY3pai8JywJhYXOlRMo6xmMxFoah2PLjWJI6eG0dDPXhMMK4BtTVBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cdq7z48B2z66X; Sat, 04 Oct 2025 02:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5942NBwV037914; Sat, 4 Oct 2025 02:23:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5942NBCf037911; Sat, 4 Oct 2025 02:23:11 GMT (envelope-from git) Date: Sat, 4 Oct 2025 02:23:11 GMT Message-Id: <202510040223.5942NBCf037911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 6cc493c79d9b - main - mtx: remove stale commentary about inlined spinlock ops 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6cc493c79d9b9f8318c87d3d6bfd225924cc933b Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6cc493c79d9b9f8318c87d3d6bfd225924cc933b commit 6cc493c79d9b9f8318c87d3d6bfd225924cc933b Author: Mateusz Guzik AuthorDate: 2025-10-04 02:20:37 +0000 Commit: Mateusz Guzik CommitDate: 2025-10-04 02:20:37 +0000 mtx: remove stale commentary about inlined spinlock ops While both locking and unlocking a spinlock used to be inline, this changed when spinlock_enter/spinlock_exit got introduced, defeating the point of inlining them. This either needs to have inlined spinlock enter/exit in place or have mtx lock/unlock as function calls with the irq flags inlined in there. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/sys/mutex.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 08d4e2d28b33..b534a74626bc 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -246,10 +246,10 @@ void _thread_lock(struct thread *); }) /* - * Lock a spin mutex. For spinlocks, we handle recursion inline (it - * turns out that function calls can be significantly expensive on - * some architectures). Since spin locks are not _too_ common, - * inlining this code is not too big a deal. + * Lock a spin mutex. + * + * FIXME: spinlock_enter is a function call, defeating the point of inlining in + * this. */ #ifdef SMP #define __mtx_lock_spin(mp, tid, opts, file, line) __extension__ ({ \ @@ -317,10 +317,10 @@ void _thread_lock(struct thread *); }) /* - * Unlock a spin mutex. For spinlocks, we can handle everything - * inline, as it's pretty simple and a function call would be too - * expensive (at least on some architectures). Since spin locks are - * not _too_ common, inlining this code is not too big a deal. + * Unlock a spin mutex. + * + * FIXME: spinlock_exit is a function call, defeating the point of inlining in + * this. * * Since we always perform a spinlock_enter() when attempting to acquire a * spin lock, we need to always perform a matching spinlock_exit() when