From nobody Fri Jan 26 21:11:29 2024 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 4TM9Nd5yCLz58r2v; Fri, 26 Jan 2024 21:11: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 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 4TM9Nd4Knpz4R1N; Fri, 26 Jan 2024 21:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706303489; 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=LaCoiRmWJw+jZubiHdgHG3oZT4fY8IepEmdEu9sLtCM=; b=fN10aqNZeZ6LqXmi+RWvcDLHYfY9KK9nmu9cLI46ndNWgMF8hmAKd0liewRzbMWii2a5FI 0KikEpIjFF/lUpk8umEBn8asG/5QL63OarEunWgqYD0HK6gfUmX1aZe+XEL3UEUH9jtZEL fuowlrvuxSbB1zk6WjaF8dfOCT5Ibu0HPebGnpBrowz/SWV1ngLP6g526KvyT+IuVMXA7k mWvw40rberh7nUdk+A5tpryF7yl3cJgOmeE9slCxl2b56y0uIckdc6b1zK54BC4fd5BvNY m7cjsZkJRQsyNtdtniSP9y6b8JZ0C3SAGK1Wcy3rTYBd9bddJJ10Ps0RjruYTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706303489; 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=LaCoiRmWJw+jZubiHdgHG3oZT4fY8IepEmdEu9sLtCM=; b=ZMGgVBqXUFyUbJKH1zNv7xEeIUl2rQoT3REoC3g0rk75f5I/rBzPZ4kPRBNKPrpA17BbRV VtJU0GvExASkEVIHQrbAcXq1ULQWkrZZCriGUai8hc0oQY/4EBNxIgTZjA1fnGU/i0b6L0 U/vW7J+V2meJs6/U24bLyG2w9PrGBR5CX9OiGYoBn5gDz9idOsOgq8zkieBIii+VI2SvKe 2zrAFBrGBD7Y1eWaUUK1XaVL05dHxfD8DOMkaMd/Sm5hT21h/cYnMdsr/LWprEfheTT71c AQBzxYJXmztR9NXHAAfxrGLhYbxPOMsfkvsdbgnj4dPfXETJ52wpyGrslUVEzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706303489; a=rsa-sha256; cv=none; b=r0cbrnUWLx57vzFZaQOBBomE3y5ADzKgTTg6Mf23FcHXbpJNBxLfQ6HZrOu8IZn6MNifvP L3M/PBW4sj69C0i2d3ZsMCHbyRE1p9ot2lVWL45LdYyggR5tMD0H8IqsU3JTTBxZX0FdVe 1gz04K6HKiFj4NzquzJVg0QAvd7yIq1Y3/0M4zrUqerW3IT1PdnKUxzp8AGEedv3WfhdYI wtgIvDw53CUhUvtHVnCZy/V8YPH5Ba5F7N34R1wKzVE37E4b6gFi4fN2OKvOAjBVx9bwx0 +Fiq8R/iofKDKlrbv7Nzz5Lflm2tC6tktHEGe6shBaFL8AV/V9ZKBVczfwOZFw== 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 4TM9Nd3Nypzx0S; Fri, 26 Jan 2024 21:11:29 +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 40QLBTl1094068; Fri, 26 Jan 2024 21:11:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40QLBTYZ094065; Fri, 26 Jan 2024 21:11:29 GMT (envelope-from git) Date: Fri, 26 Jan 2024 21:11:29 GMT Message-Id: <202401262111.40QLBTYZ094065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: cd0c52e50bc1 - main - SCHEDULER_STOPPED(): Move it (back) to 'systm.h' 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: cd0c52e50bc17f4c3fab998f9f33b1d3ada6c90e Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=cd0c52e50bc17f4c3fab998f9f33b1d3ada6c90e commit cd0c52e50bc17f4c3fab998f9f33b1d3ada6c90e Author: Olivier Certner AuthorDate: 2024-01-18 10:31:59 +0000 Commit: Olivier Certner CommitDate: 2024-01-26 21:09:16 +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 --- 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 da8701ce3858..25e2b025a11a 100644 --- a/sys/sys/kassert.h +++ b/sys/sys/kassert.h @@ -179,17 +179,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 c684f3365c35..0d3f9fe98893 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -99,6 +99,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 */