FreeBSD Bugzilla – Attachment 189605 Details for
Bug 224479
kernel panic in reboot+swapoff sys call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
swapoff, umount, swapoff
shutdown-swapoff_all.diff (text/plain), 1.77 KB, created by
ota
on 2018-01-11 05:32:00 UTC
(
hide
)
Description:
swapoff, umount, swapoff
Filename:
MIME Type:
Creator:
ota
Created:
2018-01-11 05:32:00 UTC
Size:
1.77 KB
patch
obsolete
>Index: sys/vm/swap_pager.c >=================================================================== >--- sys/vm/swap_pager.c (revision 325498) >+++ sys/vm/swap_pager.c (working copy) >@@ -143,7 +143,7 @@ > > static MALLOC_DEFINE(M_VMPGDATA, "vm_pgdata", "swap pager private data"); > static struct mtx sw_dev_mtx; >-static TAILQ_HEAD(, swdevt) swtailq = TAILQ_HEAD_INITIALIZER(swtailq); >+static TAILQ_HEAD(swdevt_head, swdevt) swtailq = TAILQ_HEAD_INITIALIZER(swtailq); > static struct swdevt *swdevhd; /* Allocate from here next */ > static int nswapdev; /* Number of swap devices */ > int swap_pager_avail; >@@ -2332,6 +2332,15 @@ > return (0); > } > >+ >+/* >+ * SWAPOFF_ALL() - disable all swap devices. >+ * >+ * This routine is called at nearly at end of shutdown. >+ * We swap off devices in the reverse order so that manually added >+ * ones are taken off, first. Quick aid ones are more likely mdconfig >+ * based swapfile or NFS files and we want to try reduces issues. >+ */ > void > swapoff_all(void) > { >@@ -2343,6 +2352,7 @@ > > mtx_lock(&sw_dev_mtx); > TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { >+ TAILQ_FOREACH_REVERSE_SAFE(sp, &swtailq, swdevt_head, sw_list, spt) { > mtx_unlock(&sw_dev_mtx); > if (vn_isdisk(sp->sw_vp, NULL)) > devname = devtoname(sp->sw_vp->v_rdev); >Index: kern/vfs_bio.c >=================================================================== >--- sys/kern/vfs_bio.c (revision 325498) >+++ sys/kern/vfs_bio.c (working copy) >@@ -1211,6 +1211,13 @@ > #ifndef PREEMPTION > int subiter; > #endif >+ /* >+ * Try swapoff, first. >+ * Swapoff NFS swap files and mdconfig swap files will results in >+ * I/O and also will cause panic if done after vfs_unmountall(). >+ * If tmpfs is consuming large memory, some may not be released. >+ */ >+ swapoff_all(); > > /* > * Sync filesystems for shutdown
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 224479
:
189605
|
189630