From nobody Tue Feb 20 08:27:59 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 4TfCG72xQRz5BdX2; Tue, 20 Feb 2024 08:27:59 +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 4TfCG72Q7wz4ZCp; Tue, 20 Feb 2024 08:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708417679; 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=zamdiJNUvICk8c1+y3rsKzN00HxvsO1nTDFar2Zg3iw=; b=Gg9nIgDYaulJq+Rle22qmPuYGHSj0iHT9KwbUQ3PZpwqGDEenDM81wBiNQP3VSKuK7QRUc AHv+Tm+De37+9x47eyQWDlDt3Rvjj5D7QVg0TbDrOEScZT5jG2/rGX4wfUtlOl7lT6r3mD f+wfCNohdE8/0jPwcCMMgBo2dzKF0LOtTQGiCqhxWpNG6lnDMZvZYCP1w+8nd7lEVcH22P h4u8GlR1CdVq3Pj1AKM+mw9VoaAkkHosK81l4DcpftMYp4RpXJqn7ZuFY5AvMUEVN/9aMp yiZRaivhYf+Z4qJ89GG/Jf/sEhlsl44BB4kMDd2HtspBDXUXdlxLJ4xVPou9Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708417679; 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=zamdiJNUvICk8c1+y3rsKzN00HxvsO1nTDFar2Zg3iw=; b=QsTeSiHyNBnJut4FKUjkEXeIlgvHz4pJL+yhn4Z83dgc/tEc7mEN4HNbcoG/+uLcJkX2zv L74HlrBWZj965LOj1YPrUtftJOrVO/Daab8L7oBP58Cr8L6rndMMcoyNGL5Ocrr6ftIUDc eDeblEB84lpsG28qL3PXefzixJW5NkaMpdkGfsXPioNID9t09u8Ydotpjygw7yexsgjF54 Xa6nUWkth+mucd+aX6rUfNiPht+f4TNqx2R3hlXT5Wxufz8WlQ1M562JBVUpipoB4IwYmZ 1nLqQHnxpQHbaz6d0vy57EVvaaNegXaDDexCwfTDA/aO6xmO2kaHIWbOoxb58g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708417679; a=rsa-sha256; cv=none; b=Tx6YtlTb3gcFT2hmIDm91MR3Ax+k5YkfueF/4hzSggsbgyiPwY0qTjoM43B/li3qPDTC/l FuCUBDaXUn9DfcU2Q/8xN8IhvHTlW17KQFRe09oRBG9OUY+cLbkP7pGaSNXDkwWqyfhGgb loacDAiciCmqRdBZj3sM4PvvCoDY2rvPqKJC723BEZRzeEPou6T3gIVmpgo+cE2jCtb0L+ jMHHYLnfc8NHLKLxAU960X9pIiYl9DQ0HIp5zj1Al5SIo7dbRAqRT66umIdj4WAk3RifY4 hEYsKHWnG93vS8zaBYo7QhQjElc2RWyyGVHhsOU/NRFJCORsOWp4QU7aVETziQ== 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 4TfCG71VK3z19pS; Tue, 20 Feb 2024 08:27:59 +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 41K8RxZI081227; Tue, 20 Feb 2024 08:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41K8Rx6x081224; Tue, 20 Feb 2024 08:27:59 GMT (envelope-from git) Date: Tue, 20 Feb 2024 08:27:59 GMT Message-Id: <202402200827.41K8Rx6x081224@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: a6d066d0120f - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: a6d066d0120f0b83efca4e618050557a91259a30 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a6d066d0120f0b83efca4e618050557a91259a30 commit a6d066d0120f0b83efca4e618050557a91259a30 Author: Olivier Certner AuthorDate: 2024-01-18 10:31:59 +0000 Commit: Olivier Certner CommitDate: 2024-02-20 08:27:07 +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 9a0932e50dc9..3721db649a3d 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 */