From nobody Fri Dec 3 08:50:18 2021 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 9FC1E18AAE39; Fri, 3 Dec 2021 08:50:18 +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 4J563G2gVXz3kmZ; Fri, 3 Dec 2021 08:50:18 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3BC5B5D92; Fri, 3 Dec 2021 08:50:18 +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 1B38oIc2096088; Fri, 3 Dec 2021 08:50:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B38oI5b096084; Fri, 3 Dec 2021 08:50:18 GMT (envelope-from git) Date: Fri, 3 Dec 2021 08:50:18 GMT Message-Id: <202112030850.1B38oI5b096084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a5c2d59ed3d6 - main - Expand comment explaining reasons for automatic swapoff on shutdown 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a5c2d59ed3d6365c26322f3e100467454774b501 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638521418; 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=rPSN8RsMwy5d0MYG06KPk/bsy2L4nqFsZqomduveHDA=; b=ugFy/dfLVbFTbY4TSfS4io0TUZkkqrJwywH8IGQgJL2QKNvMFJ35RVLNCxf0mF51JrLPdw 5MFGfy+eQ6aRv8O4zTtp0tsrj1cDymzGD40EQXL8RwnMrfK9resl19RyxmdtVnZm2HpMvs 2srzJkSzCJ+aGjSEHzEREK3mDDpEAV0zhmwZ4Jt+TIoTVvCLkngjhYG5lEp46stsgtfFfc 5HdAIJAzj4uOkbHl3DvZUb3HkCavhbO0LfwJxV4wYsOGDM6cWk4F67/RJOda/0tZfXfINw o2wwOWwrfICTGiqziLYdsnie02C8EBDT/IV6CsT54ZEeBN11m2PDIOJJqr/NRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638521418; a=rsa-sha256; cv=none; b=NvxXYbKnAYTRWn6ibhyx9PfqLQXkwCotUhZ5nOEpxKFWcnqkapesbkUOvu7mJvT/rC20MD h0AaFyT+HACb7yfbeZGbkr6FkmRNArtYsGU6izMEi2m6rMPZ7qg1xVwCHwS710PUkz3zN9 6bl5kNwR47vPJJXprtLCqhfjKkbVapkdxDMaUHf3ZhrLh0C11wDan22vkUvcJobMUJqRIr s62t8QtummrwOe4C5ADukw6nrPErfkbYcoJYzJxnzT9ZpjAxW/vayFE2GAKdJ9l2wG+S86 9XgLdfG2mvqqvPNKxiNJ3Gj2lav6wRmNdCeTN+QyVHUo9JMukUaZ9BF5pBdiRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a5c2d59ed3d6365c26322f3e100467454774b501 commit a5c2d59ed3d6365c26322f3e100467454774b501 Author: Konstantin Belousov AuthorDate: 2021-11-29 19:11:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-03 08:42:21 +0000 Expand comment explaining reasons for automatic swapoff on shutdown Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33167 --- sys/kern/vfs_bio.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 61fe9a6e2bfd..acd16ecdf3fe 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1458,9 +1458,16 @@ bufshutdown(int show_busybufs) printf("Final sync complete\n"); /* - * Unmount filesystems. Swapoff before unmount, - * because file-backed swap is non-operational after unmount - * of the underlying filesystem. + * Unmount filesystems and perform swapoff, to quiesce + * the system as much as possible. In particular, no + * I/O should be initiated from top levels since it + * might be abruptly terminated by reset, or otherwise + * erronously handled because other parts of the + * system are disabled. + * + * Swapoff before unmount, because file-backed swap is + * non-operational after unmount of the underlying + * filesystem. */ if (!KERNEL_PANICKED()) { swapoff_all();