From nobody Tue Feb 20 09:01:12 2024 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 4TfD0S6nLXz5Bgn0; Tue, 20 Feb 2024 09:01:12 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfD0S61gDz4dGV; Tue, 20 Feb 2024 09:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708419672; 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=OtUaeT35NeR5vh4Jwz/K7+uKnYe4MN3pY2EouWbmsgQ=; b=XhhtHYjuIb4BqndHPITFjexbqEIp+POKB2ONKU3Q9CvXkq/c48KLIBlEjgCrLruILyYhDM xIDf34n8H4flcubO+dvJIzbYwO4jsWa+FXDyBn2O4Vdwe7ohaJbDFXQIWvtowDe5fld7FQ XRsxp0XeZ5DuiO/AyA4ZXsGzlPBC/AAGIPH0Zgv1b899B+OLJuLJO2xkYHKAMD2O+lGsGe 9TjVdWzsuBiVkOWKLMbAfTKSxFjD98GdbgNmkuz3/gxW15rV5h4ZZlL8XX6EltYCl7zNKK ub6qD5K3hDmh3N153YRyNq2SPChlYWEwr9voGxbgwr5BpqVky0YIZoWFt4FmsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708419672; 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=OtUaeT35NeR5vh4Jwz/K7+uKnYe4MN3pY2EouWbmsgQ=; b=GQ7751LLuR7gU18wM2NoELhszeL6qThLo+YhtRK+CIwzDxrjNgPHxp9EygGI5RVv4gBM9w ANeCTdItZgKKc8FUcUArB+8ZYhiSmS7YuE1XVScQlf5WXJMMJJ+UIvlJCLNaWdRsM7MQuv qWRLnVbNJmGXDekq+vAaR1HiR31JpMZOI8IRSs7aZEWUBReYTLFWLMT6VTlNeNCBKiNfmg /lmbdk+2AyvHWwyyDe3WAtIhtS95FD/TWWLZb8+Rp+A9Ql+Lwj69JXVkWds8JdKYb1M9mR ifIqlHYgx833mniwQeTQZ0Ii6ED1LkzqVckPls3TVwfv+q+/k9Bzxb8xrRJfug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708419672; a=rsa-sha256; cv=none; b=GQZFqejAOgbWEeJNPINRbTyuE9MdbHZBAcOkaveBHnfTx5Tvb5NMvn36OBFblPPpnLHRfM MWw6tk9WrNKn9IwmcvnZ0U0Q5lBvRoP7Vk40dbUFkGus0L27FahrUewRDnXfLaTkGowWj7 tPzs8PWjpaWMxYlxu5FHJgwFsbQskh9toXGCsfFPL+uNGNxQTBfidVTVPMoesnX+gP8+Xz e8VKNKyS5WSYN57DIF0WrH/5UiD/AvHHPAP2jj6TVxOGCVzChLSTlCm59xz5KdbK2xq1RO qoKcfGBUGGGfoMMXXe/x6SN6A9DX4kenQBBtDK+h05Yx5v3ZqzE1DRIPPEUAsw== 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 4TfD0S4p2Wz1BHy; Tue, 20 Feb 2024 09:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41K91CQR042944; Tue, 20 Feb 2024 09:01:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41K91Cng042941; Tue, 20 Feb 2024 09:01:12 GMT (envelope-from git) Date: Tue, 20 Feb 2024 09:01:12 GMT Message-Id: <202402200901.41K91Cng042941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ab978c432e4d - stable/13 - SCHEDULER_STOPPED(): Move it (back) to 'systm.h' 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ab978c432e4d3495f2720a485992ee523dbc582c Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ab978c432e4d3495f2720a485992ee523dbc582c commit ab978c432e4d3495f2720a485992ee523dbc582c Author: Olivier Certner AuthorDate: 2024-01-18 10:31:59 +0000 Commit: Olivier Certner CommitDate: 2024-02-20 09:00:41 +0000 SCHEDULER_STOPPED(): Move it (back) to 'systm.h' It's not an assertion, so doesn't logically belong to 'kassert.h'. Moreover, a subsequent commit will make it rely on a variable whose declaration also belongs to 'systm.h'. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43571 (cherry picked from commit cd0c52e50bc17f4c3fab998f9f33b1d3ada6c90e) Approved by: markj (mentor) --- sys/sys/kassert.h | 11 ----------- sys/sys/systm.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/sys/kassert.h b/sys/sys/kassert.h index d7c1a21385f9..da7b66854a14 100644 --- a/sys/sys/kassert.h +++ b/sys/sys/kassert.h @@ -149,17 +149,6 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2); #define CRITICAL_ASSERT(td) \ KASSERT((td)->td_critnest >= 1, ("Not in critical section")) -/* - * If we have already panic'd and this is the thread that called - * panic(), then don't block on any mutexes but silently succeed. - * Otherwise, the kernel will deadlock since the scheduler isn't - * going to run the thread that holds any lock we need. - */ -#define SCHEDULER_STOPPED_TD(td) ({ \ - MPASS((td) == curthread); \ - __predict_false((td)->td_stopsched); \ -}) -#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) #endif /* _KERNEL */ #endif /* _SYS_KASSERT_H_ */ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index dcfe84e91cc2..d073c87af163 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -101,6 +101,18 @@ struct ucred; #include /* curthread */ #include +/* + * If we have already panic'd and this is the thread that called + * panic(), then don't block on any mutexes but silently succeed. + * Otherwise, the kernel will deadlock since the scheduler isn't + * going to run the thread that holds any lock we need. + */ +#define SCHEDULER_STOPPED_TD(td) ({ \ + MPASS((td) == curthread); \ + __predict_false((td)->td_stopsched); \ +}) +#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) + extern int osreldate; extern const void *zero_region; /* address space maps to a zeroed page */