aboutsummaryrefslogtreecommitdiffstats
path: root/module/zcommon
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-12-10 00:29:00 -0500
committerGitHub <[email protected]>2020-12-09 21:29:00 -0800
commite0716250bf34159082d96f04200063e3edb114b6 (patch)
treeafa5b83fdd7760e1fbd18baf5b33508e395d77ba /module/zcommon
parentb9916b40647cfe615ba90612e0049ae8feac0dd1 (diff)
FreeBSD: Do zcommon_init sooner to avoid FPU panic
There has been a panic affecting some system configurations where the thread FPU context is disturbed during the fletcher 4 benchmarks, leading to a panic at boot. module_init() registers zcommon_init to run in the last subsystem (SI_SUB_LAST). Running it as soon as interrupts have been configured (SI_SUB_INT_CONFIG_HOOKS) makes sure we have finished the benchmarks before we start doing other things. While it's not clear *how* the FPU context was being disturbed, this does seem to avoid it. Add a module_init_early() macro to run zcommon_init() at this earlier point on FreeBSD. On Linux this is defined as module_init(). Authored by: Konstantin Belousov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11302
Diffstat (limited to 'module/zcommon')
-rw-r--r--module/zcommon/zfs_prop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c
index 89ddc59b2..b78331187 100644
--- a/module/zcommon/zfs_prop.c
+++ b/module/zcommon/zfs_prop.c
@@ -1016,7 +1016,7 @@ zcommon_fini(void)
kfpu_fini();
}
-module_init(zcommon_init);
+module_init_early(zcommon_init);
module_exit(zcommon_fini);
#endif