FreeBSD Bugzilla – Attachment 224325 Details for
Bug 255261
Slow unmount of (ZFS) filesystem at reboot time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Progress indicator during vfs_unmount at shutdown
vfs_unmount.patch (text/plain), 1.92 KB, created by
Peter Eriksson
on 2021-04-21 09:34:57 UTC
(
hide
)
Description:
Progress indicator during vfs_unmount at shutdown
Filename:
MIME Type:
Creator:
Peter Eriksson
Created:
2021-04-21 09:34:57 UTC
Size:
1.92 KB
patch
obsolete
>Index: sys/kern/vfs_subr.c >=================================================================== >--- sys/kern/vfs_subr.c (revision 369637) >+++ sys/kern/vfs_subr.c (working copy) >@@ -79,6 +79,7 @@ > #include <sys/stat.h> > #include <sys/sysctl.h> > #include <sys/syslog.h> >+#include <sys/time.h> > #include <sys/vmmeter.h> > #include <sys/vnode.h> > #include <sys/watchdog.h> >@@ -4162,12 +4163,25 @@ > vfs_unmountall(void) > { > struct mount *mp, *tmp; >+ unsigned int n, ns, n_fs; >+ time_t t0, t1, dt, ts; > > CTR1(KTR_VFS, "%s: unmounting all filesystems", __func__); > > /* >+ * Count the number of filesystems to unmount >+ */ >+ n_fs = 0; >+ TAILQ_FOREACH_REVERSE_SAFE(mp, &mountlist, mntlist, mnt_list, tmp) { >+ ++n_fs; >+ } >+ printf("Unmounting %u filesystems:\n", n_fs); >+ t0 = ts = time_second; >+ >+ /* > * Since this only runs when rebooting, it is not interlocked. > */ >+ ns = n = 0; > TAILQ_FOREACH_REVERSE_SAFE(mp, &mountlist, mntlist, mnt_list, tmp) { > vfs_ref(mp); > >@@ -4179,10 +4193,40 @@ > continue; > > unmount_or_warn(mp); >+ >+ /* >+ * If more than 20 filesystems to unmount, print a running count >+ * every second, else print the filesystem names (with thousands >+ * of filesystems this becomes too tedious (and slows down the >+ * reboot process even more...) >+ */ >+ ++n; >+ if (n_fs > 20) { >+ t1 = time_second; >+ if (t1 != ts) { >+ dt = t1 - t0; >+ printf(" %6u of %u [%u%% done, %d fs/s (cur), %ld fs/s (avg)] \r", >+ n, n_fs, n*100/n_fs, n-ns, n/dt); >+ ts = t1; >+ ns = n; >+ } >+ } else { >+ printf(" %2u. %s\n", n, mp->mnt_stat.f_mntonname); >+ } > } > >- if (rootdevmp != NULL) >+ if (rootdevmp != NULL) { > unmount_or_warn(rootdevmp); >+ ++n; >+ } >+ >+ dt = time_second - t0; >+ if (dt != 0) >+ printf("%u filesystem%s unmounted in %lds (%ld fs/s). \n", >+ n, n == 1 ? "" : "s", dt, n/dt); >+ else >+ printf("%u filesystem%s unmounted.\n", >+ n, n == 1 ? "" : "s"); > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 255261
:
224295
|
224325
|
224326
|
224327
|
224366
|
224367