From nobody Sat Nov 04 14:49:37 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 4SN0rK2JpXz4yRZg; Sat, 4 Nov 2023 14:49:37 +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 4SN0rK1sHqz4Y6H; Sat, 4 Nov 2023 14:49:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699109377; 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=6/rjWxjsdzOtP722pO1LhpZcHglzd/Lc8XrjlQUkibw=; b=VMIthXWkA24d3qHK1vl1bVmG9CoWWMLxwyHjtyw7Ug5TR4dePbM2uCqFYlS1oev+hTHd3e Zjp9yFmcUEZ3/VdlWzvrsLqL4jcSV3sqtZ1BpcE5bUFzK6sGHzc9Lml61po91fwpJ1PUB6 7okD/Od7Q90/rPeSimCfm/yo6zcatvaCYESUEi1l3coRr743ctdFuWqzsLxvNyVAuPWVE1 qu1Vdl7nJuoTMPy98o7zrcNcM/WCjbd+F3N4SVYT2V+ZwcNabMWlG/IVlP9zaBxS7eoZQQ wunaxE2N9/qN9qqtx62Wn0768yKc8MWnLp5z8+a5ID2UUsq1VidgEp/LxYG6+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699109377; 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=6/rjWxjsdzOtP722pO1LhpZcHglzd/Lc8XrjlQUkibw=; b=wI1PLgFgfUz5iDXsvag03ZLe4I7cCL8wEWaAjqMB2IyA6FuUciJBZO2KbgjuwuR9HXALup y+KJM3JwLlMEVmQ4yGemt1h4wRsGzTlhYzlsSZZptaB9h2XgKrYy12D48/cOMDUzhxWHSp ZSmmpWOYOQG5PoHVkW1d01/hccyjL4MTdVguKJRCJYGPRzRgcbM5tzjuOnFSyNMP+8FZ04 DLf/d0zAi2WyXHTKbrnzW9CRPrdzMg6tCRdpqAD7LKy6DBRJfdQTwqt7LQCERejf8kA0vH qhoyrPET7Qxyci+r6xM7eWFNksz1kndOZKX0nrjohi34ko31NfroFFeDtRvn4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699109377; a=rsa-sha256; cv=none; b=rwoXKUOlBniZUxtuFOZkkqEk4t8sJRc3CwTSKvX5kQy0QEBdKIse2Xmdriz757naq43swq SeZ7P8zNMIKhioPHKXh6modad/2BySSvNTmeb36GqjxcBFqBXNVNostMR2VWFj9SzVBVPb H4C0GOR+sbNVwF9u562uCguL50qu4mzp2rt4QteZlKxIjqHVkS6RFf85nhWHfrESLREZBB a8B7p70362eKe1Q3FWjo2FODU1uDzyf39GkBG7um6BbU4s7WK8O4Ip/IYCT3fzRdmpT0rT aMWokKyRab0DdPOKGGLd/IASdxhliDK6Ws0WHltFKC+2/UbdSqETMtDOhUoLCg== 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 4SN0rK0xMsz12Jv; Sat, 4 Nov 2023 14:49:37 +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 3A4EnbUt053411; Sat, 4 Nov 2023 14:49:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A4Enbk6053408; Sat, 4 Nov 2023 14:49:37 GMT (envelope-from git) Date: Sat, 4 Nov 2023 14:49:37 GMT Message-Id: <202311041449.3A4Enbk6053408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: deacab756026 - main - reboot: Avoid unlocking Giant if the scheduler is stopped 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: deacab756026f86515781944a9e0271e8db9f86b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=deacab756026f86515781944a9e0271e8db9f86b commit deacab756026f86515781944a9e0271e8db9f86b Author: Mark Johnston AuthorDate: 2023-11-04 14:48:58 +0000 Commit: Mark Johnston CommitDate: 2023-11-04 14:48:58 +0000 reboot: Avoid unlocking Giant if the scheduler is stopped When the scheduler is stopped, mtx_unlock() turns into a no-op, so the loop while (mtx_owned(&Giant)) mtx_unlock(&Giant); runs forever if the calling thread has Giant locked. Reviewed by: mhorne MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42460 --- sys/kern/kern_shutdown.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index e0eff6dbec01..19920d30357f 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -471,7 +471,7 @@ kern_reboot(int howto) * deadlock than to lock against code that won't ever * continue. */ - while (mtx_owned(&Giant)) + while (!SCHEDULER_STOPPED() && mtx_owned(&Giant)) mtx_unlock(&Giant); #if defined(SMP)