From nobody Thu Nov 23 16:08:00 2023 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 4Sbjh03rHSz51nGb; Thu, 23 Nov 2023 16:08:00 +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 4Sbjh0300hz4QDZ; Thu, 23 Nov 2023 16:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700755680; 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=2A3bY2UnB2vJJiFstCz6J0IgPin+1fRBJNyZHEgO54k=; b=aEkkh94wLJbGbFO0pAt+zffjzLA6rWJEYE/ZPqJeRzYz3C0WoideseK/hzGXYW6wiG+6j9 YCwbSCoxmheFpgEXiNX4VuGd17+XTVpLqWT4n8YnFeQV449hOXd4pOSjzYhc+JofVPyltz jvwR7Fz60C9xsczB1XqF1/x41YMPbk+nxPpElQKn7ABGu1wNdtsOIOflFtyW/rTxsYWW/a zqOBKo0Nuc7/5psxGmGCuPDAmdU/C2zW5q3Hm4rwb2TqukhIwJkh4SUARGOTT+2ZTXIhT4 IWa9VeHilwnV/91OCs9+sThyj2tPskImyNsunnNvNBQEHV3RIQCNPJeJsGW1GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700755680; 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=2A3bY2UnB2vJJiFstCz6J0IgPin+1fRBJNyZHEgO54k=; b=GBQSjBZ3PtxFSyNYhDUh6OC6LnwQpi0J7Y8qWOK+LtBzhVZWogikyxaqz5lI03d15Q49FE yw+wugMJzgXzPJhbRfFAoYKWv5jJDP+YlwaNSbak8aBs5EeK+URWD4Hd9fLaCU7zVIvw45 5Se8NUbqrO+qlfijLi4PJD1yOV5/4WKZKxwYCkq/grYbcoMOdOWEIqQJu1oj3km8hXtwN+ 08yANhDGn5Go6TpMy3KT8QG0m4YkLPhHfTIFmQLIZVdy9N4xnfV+k8ubeTO9+MosrNp4Wd 3gW7GHN1MwBWBTjp6TvcfSk37aolYqnkP2H59kSB0CxE10ErTDPxSCbDWcaqsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700755680; a=rsa-sha256; cv=none; b=b13kuNYOiF/3pZTgQRD93Q9vfNw268qpbpMxKiqVJdK+E4WJPIZmeFbAQnZy02HlbcmYvZ XIfSDjfPkpK3ymZpqu9YmHXugTN2tCZndXhzV+KeGHxYuV06wk4hPn41k/BZDEiSNkkaCY 2atmMPNLR0OAtrJMY7oqfwZv6QOTu4Td7N76Le/jJVDOuDydm8orbd9spVGvoM4yRl3uuh D031DXfg+5jV/8O0v16zEcZJMAZCvrJS5hW6GKDlyqKmS4/HLFZb/qny+2kO1wgrmRXq8T tbOlNsccUa6U6Lh9NzmhushLB/fn8Fphar5XICccjLVXkYcdx+IQX0Moo46tQA== 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 4Sbjh01v6Mz17fZ; Thu, 23 Nov 2023 16:08:00 +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 3ANG80CY007539; Thu, 23 Nov 2023 16:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ANG80dG007536; Thu, 23 Nov 2023 16:08:00 GMT (envelope-from git) Date: Thu, 23 Nov 2023 16:08:00 GMT Message-Id: <202311231608.3ANG80dG007536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: d79a9edb5ce1 - main - alq, siftr: add panic/debugger checks to shutdown hooks 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d79a9edb5ce162c1ba49e12e5c93b894e6a25ad2 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d79a9edb5ce162c1ba49e12e5c93b894e6a25ad2 commit d79a9edb5ce162c1ba49e12e5c93b894e6a25ad2 Author: Mitchell Horne AuthorDate: 2023-11-23 15:25:30 +0000 Commit: Mitchell Horne CommitDate: 2023-11-23 16:07:42 +0000 alq, siftr: add panic/debugger checks to shutdown hooks Don't try to gracefully terminate the pkt_manager thread if the scheduler is not running. We should not attempt to shutdown ald if RB_NOSYNC is set, and must not if the scheduler is stopped (the function calls wakeup()). Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42340 --- sys/kern/kern_alq.c | 14 +++++++++----- sys/netinet/siftr.c | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index 51fd66f2fe9f..1bcce92509c5 100644 --- a/sys/kern/kern_alq.c +++ b/sys/kern/kern_alq.c @@ -37,19 +37,20 @@ #include #include +#include +#include +#include #include #include #include +#include #include #include #include #include -#include -#include -#include +#include #include -#include -#include +#include #include @@ -228,6 +229,9 @@ ald_shutdown(void *arg, int howto) { struct alq *alq; + if ((howto & RB_NOSYNC) != 0 || SCHEDULER_STOPPED()) + return; + ALD_LOCK(); /* Ensure no new queues can be created. */ diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index fbb47fc4a521..13b26e61b5d4 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -74,6 +74,7 @@ #include #include #include +#include #include #include #include @@ -1300,8 +1301,11 @@ siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) } static void -siftr_shutdown_handler(void *arg) +siftr_shutdown_handler(void *arg, int howto) { + if ((howto & RB_NOSYNC) != 0 || SCHEDULER_STOPPED()) + return; + if (siftr_enabled == 1) { siftr_manage_ops(SIFTR_DISABLE); }