From nobody Tue Jul 19 00:23:40 2022 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 4Ln01S2l3Nz4TQ91; Tue, 19 Jul 2022 00:23:40 +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 4Ln01S22Mnz47kV; Tue, 19 Jul 2022 00:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658190220; 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=4j1xiZVW31NJuudjtM4qcqlx/A4ZmYi56d/toH6zX3Y=; b=Yw13HSXAiB+q+a7BPoBq7Z3WN+/RQh93jWFX9Yg6kbmnv3ObJAr3dyNOLfkycnu2BTuUsQ Gi4aKRC/SW0JNM0Wqc+bpZljbmwmsT0ClPKPkcDsjiMJ7nA0YNF0K9vKCSoWYa4S+EO1rY mUjaacqKZzFb1khoVXVFyb7BTInGE077Dpb9VMlldqFfOX44myv/3YIDHa10xmFpoHUhyo aQWG3x228vZKm+D+WUb+NzjzQi/oZhxtO/EMOoA7He1wIlT5PIfzZaP7hKzFgxdswmf5Ou Xrb2R4qDGbU7lbh1reflwvSkBaJ2OWI7XuAV2yfadrZNEB4UgXiJ1wrTUaVGBQ== 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 4Ln01S13nCzypM; Tue, 19 Jul 2022 00:23:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26J0NeZq036519; Tue, 19 Jul 2022 00:23:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26J0Neu0036518; Tue, 19 Jul 2022 00:23:40 GMT (envelope-from git) Date: Tue, 19 Jul 2022 00:23:40 GMT Message-Id: <202207190023.26J0Neu0036518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 84ec7df0d796 - main - Add kern.reboot_wait_time sysctl 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84ec7df0d796ddab6301817e12904762e2724c8e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658190220; 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=4j1xiZVW31NJuudjtM4qcqlx/A4ZmYi56d/toH6zX3Y=; b=RN2+BQr6Tw9NPgl3pbogqTHLASVJ7PE1OzZBf+jKzyhaU+EFGpp2oEyfJmKwPC2kqRbtq6 LhvwdK8HsDcHkW7VqmO6/Ls9NHt0RinQclXvlh0wgBvzMEZt3KDceQ0JrD6ednvTShV7lp HkQUuEAxcAH3c1/v74CkBEWXsN95baxJljhsNOF0oPyN1pxaLW47Coi7wH7zb95yM0beqF I51vSAqKbVa+23Ga0aXIkDk8mHxOm7nRFufqJbveWsYcp5HcHmuymJusmnVBreEzPRyq/E EYAXgA1flzwCBHnVjF/6GZZRRxpKYIirToq7E4/3k4Ww3+3JKX6NqrPrT+RBPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658190220; a=rsa-sha256; cv=none; b=iFZy+SW9kYSKb5HnbEtG1LHXhO/t61TFmQKPTkCbYQO7XRDmx5HsWmiUPY5iB4TJKSDqOy 4meE7CpnTu0NBkfb2mFYdbJz5/8Dzfg/3spjAzZA7sSVWCow9xFPq7WSrqs6dW32Jp99mq iXE97dZMPxejT5vWTIAxIoTyW0hT+h+ajpJP/sj2pZOmLOpzONuFDGV5E/l0mzF6U0ApA6 k+kMZfhH4kChtjH72gGSvMmbJeS+rBEYkrRwUVtD+ycKpvHrcJ3Onr4Poni6/oVD7fE1d/ YNO9CUb7OE76PqI3F5OiFrTJQmlNtUcp43KJW2ZHgmlsL9R8gBTC/FarqtB3rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=84ec7df0d796ddab6301817e12904762e2724c8e commit 84ec7df0d796ddab6301817e12904762e2724c8e Author: Colin Percival AuthorDate: 2022-07-13 00:42:26 +0000 Commit: Colin Percival CommitDate: 2022-07-19 00:23:25 +0000 Add kern.reboot_wait_time sysctl Historic FreeBSD behaviour (dating back to 1994-04-02) when rebooting is to print "Rebooting..." and then /* wait 1 sec for printf's to complete and be read */ Prior to April 1994, there was a 100 ms delay (added 1993-11-12). Since (a) most users will already be aware that the system is rebooting and do not need to take time to read an additional message to that effect, and (b) most FreeBSD systems don't have anyone actively looking at the console anyway, this delay no longer serves much purpose. This commit adds a kern.reboot_wait_time sysctl which defaults to 0; historic behaviour can be regained by setting it to 1. Reviewed by: imp Relnotes: FreeBSD now reboots faster; to restore the traditional wait after printing "Rebooting..." to the console, set kern.reboot_wait_time=1 (or more). Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D35796 --- sys/kern/kern_shutdown.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 87afc175a72d..ab37b54667f9 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -111,6 +111,10 @@ static int panic_reboot_wait_time = PANIC_REBOOT_WAIT_TIME; SYSCTL_INT(_kern, OID_AUTO, panic_reboot_wait_time, CTLFLAG_RWTUN, &panic_reboot_wait_time, 0, "Seconds to wait before rebooting after a panic"); +static int reboot_wait_time = 0; +SYSCTL_INT(_kern, OID_AUTO, reboot_wait_time, CTLFLAG_RWTUN, + &reboot_wait_time, 0, + "Seconds to wait before rebooting"); /* * Note that stdarg.h and the ANSI style va_start macro is used for both @@ -710,7 +714,7 @@ shutdown_reset(void *junk, int howto) { printf("Rebooting...\n"); - DELAY(1000000); /* wait 1 sec for printf's to complete and be read */ + DELAY(reboot_wait_time * 1000000); /* * Acquiring smp_ipi_mtx here has a double effect: