git: aebdfa9515d4 - stable/13 - Expand comment explaining reasons for automatic swapoff on shutdown
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 06 Dec 2021 00:30:10 UTC
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=aebdfa9515d4a81c791a5342e5c3b898fb79cfec
commit aebdfa9515d4a81c791a5342e5c3b898fb79cfec
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-29 19:11:33 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-12-06 00:29:43 +0000
Expand comment explaining reasons for automatic swapoff on shutdown
(cherry picked from commit a5c2d59ed3d6365c26322f3e100467454774b501)
---
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 511bcb746a00..d32cad8a7fd5 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1449,9 +1449,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();