From nobody Tue Nov 07 00:23:50 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 4SPTTy3hhdz50q82; Tue, 7 Nov 2023 00:23:50 +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 4SPTTy3Dkcz4cwF; Tue, 7 Nov 2023 00:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699316630; 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=Ew2nJJy0OeftcfI8TUZh0rEKe69VinhCv+BsuWolGfc=; b=O2STUbZbKNdIE0hyotfPNQH5BK9tRbuT1BrlnmVuqFE9b/7kU0kigSo52OnY65tMwUmnGi ApWnltETwfY4hZkvZlgmGePKnWOuvW7kUmUWx0W8j8EGtW21645powo7s3Yh5QNcVoc1tB X3FRq8XKwA4n1q/J37rpgRoVwqck0jcWCW3imbSZDFU+SKUSpqC+m1IW7MlRkObezvXcO9 48qsBcZnGczxl6TJbhR/6CwTfA3yW243EoGXQg5BC1c4OcTSKBKhn2RjlEjfoJ+hWRH21D nOcB2unQPDANdx9PXtfE7CkpPEAG+HgYEIEn1Ckr09ogyZwaJGW8RLzZit3xFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699316630; 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=Ew2nJJy0OeftcfI8TUZh0rEKe69VinhCv+BsuWolGfc=; b=upwLi9mjKvhOEXZrrWezcmKmpthUhyNp9V0MTf+o4u7nP9njZtQGMyeXS899yYZeWRv7O5 RjEmOeEu03XWdhGlUJbwCzN4a+YbmW488+PxXE9dO7I5adoJPyEMdZHB3oU4ddiRhKXbIv S+cJ8VD6q8V+9X7SOehXpsMLxU6WfRXUZtIocBWlS9PZtSvRggKPEZHQKV+7kNlIGhOFlf iHmq0q7tu1ruXc6NSYMzebINeXnXhN5wQ4FXbtIvOrFUEQhOIFFLNUPhNuBKL6huxJpkaB 5TzhCWvMRBYGc5T5gCqKNGW7C1Z5VItue8TneL33NE1MS5ppROGEiTO/+3JikA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699316630; a=rsa-sha256; cv=none; b=lu0eULppOc74c2nzUrOMQap/IhIn1+2EHjdBAp2GXpcrHhWFDR6OAtsMjp37xArVZhqI2T ZreDZyR0bsKbw0vFASE96SE/0EW6yCKYcxW6QPjxLsO2YrQOff16fFZVZYiN4uDqn4377u V7w+okqvukhaBlkgezRf5fzHh+WCPlrzFTjRoOt8c4kIVPpV1Dcl95Ep+eRnl1jUm0F3RV fD76DQ9NiAK366ituu44T74uGcKkAUb454/9eyB8ZPeAKAsb5ITA6TLburOSocVjFHHycX hXr18qjMYnJKlUEWA1Z7ewfUqP02IFvt7dB8p3RRqsgBudHWivjK9+vGUfHmiA== 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 4SPTTy2KctzTgW; Tue, 7 Nov 2023 00:23:50 +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 3A70No8B032988; Tue, 7 Nov 2023 00:23:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A70NoLo032985; Tue, 7 Nov 2023 00:23:50 GMT (envelope-from git) Date: Tue, 7 Nov 2023 00:23:50 GMT Message-Id: <202311070023.3A70NoLo032985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8da1c3715139 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8da1c3715139ecfbda9159c766507e0f80212e92 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8da1c3715139ecfbda9159c766507e0f80212e92 commit 8da1c3715139ecfbda9159c766507e0f80212e92 Author: Mark Johnston AuthorDate: 2023-11-04 14:48:58 +0000 Commit: Mark Johnston CommitDate: 2023-11-07 00:23:38 +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 (cherry picked from commit deacab756026f86515781944a9e0271e8db9f86b) --- 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)