diff --git a/config/kernel-hotplug.m4 b/config/kernel-hotplug.m4 deleted file mode 100644 index e796a6d2e..000000000 --- a/config/kernel-hotplug.m4 +++ /dev/null @@ -1,26 +0,0 @@ -dnl # -dnl # 4.6 API change -dnl # Added CPU hotplug APIs -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_CPU_HOTPLUG], [ - ZFS_LINUX_TEST_SRC([cpu_hotplug], [ - #include - ],[ - enum cpuhp_state state = CPUHP_ONLINE; - int (*fp)(unsigned int, struct hlist_node *) = NULL; - cpuhp_state_add_instance_nocalls(0, (struct hlist_node *)NULL); - cpuhp_state_remove_instance_nocalls(0, (struct hlist_node *)NULL); - cpuhp_setup_state_multi(state, "", fp, fp); - cpuhp_remove_multi_state(0); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_CPU_HOTPLUG], [ - AC_MSG_CHECKING([whether CPU hotplug APIs exist]) - ZFS_LINUX_TEST_RESULT([cpu_hotplug], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CPU_HOTPLUG, 1, [yes]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 6abaa934a..ae3ca7a60 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -124,7 +124,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_TOTALRAM_PAGES_FUNC ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES ZFS_AC_KERNEL_SRC_PERCPU - ZFS_AC_KERNEL_SRC_CPU_HOTPLUG ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR ZFS_AC_KERNEL_SRC_MKNOD ZFS_AC_KERNEL_SRC_SYMLINK @@ -259,7 +258,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_TOTALRAM_PAGES_FUNC ZFS_AC_KERNEL_TOTALHIGH_PAGES ZFS_AC_KERNEL_PERCPU - ZFS_AC_KERNEL_CPU_HOTPLUG ZFS_AC_KERNEL_GENERIC_FILLATTR ZFS_AC_KERNEL_MKNOD ZFS_AC_KERNEL_SYMLINK diff --git a/module/os/linux/spl/spl-taskq.c b/module/os/linux/spl/spl-taskq.c index ba6a1e10e..1c35cf3e4 100644 --- a/module/os/linux/spl/spl-taskq.c +++ b/module/os/linux/spl/spl-taskq.c @@ -28,9 +28,7 @@ #include #include #include -#ifdef HAVE_CPU_HOTPLUG #include -#endif static int spl_taskq_thread_bind = 0; module_param(spl_taskq_thread_bind, int, 0644); @@ -74,10 +72,8 @@ EXPORT_SYMBOL(system_delay_taskq); static taskq_t *dynamic_taskq; static taskq_thread_t *taskq_thread_create(taskq_t *); -#ifdef HAVE_CPU_HOTPLUG /* Multi-callback id for cpu hotplugging. */ static int spl_taskq_cpuhp_state; -#endif /* List of all taskqs */ LIST_HEAD(tq_list); @@ -1068,7 +1064,7 @@ taskq_create(const char *name, int threads_arg, pri_t pri, return (NULL); tq->tq_hp_support = B_FALSE; -#ifdef HAVE_CPU_HOTPLUG + if (flags & TASKQ_THREADS_CPU_PCT) { tq->tq_hp_support = B_TRUE; if (cpuhp_state_add_instance_nocalls(spl_taskq_cpuhp_state, @@ -1077,7 +1073,6 @@ taskq_create(const char *name, int threads_arg, pri_t pri, return (NULL); } } -#endif spin_lock_init(&tq->tq_lock); INIT_LIST_HEAD(&tq->tq_thread_list); @@ -1162,12 +1157,11 @@ taskq_destroy(taskq_t *tq) tq->tq_flags &= ~TASKQ_ACTIVE; spin_unlock_irqrestore(&tq->tq_lock, flags); -#ifdef HAVE_CPU_HOTPLUG if (tq->tq_hp_support) { VERIFY0(cpuhp_state_remove_instance_nocalls( spl_taskq_cpuhp_state, &tq->tq_hp_cb_node)); } -#endif + /* * When TASKQ_ACTIVE is clear new tasks may not be added nor may * new worker threads be spawned for dynamic taskq. @@ -1291,7 +1285,6 @@ module_param_call(spl_taskq_kick, param_set_taskq_kick, param_get_uint, MODULE_PARM_DESC(spl_taskq_kick, "Write nonzero to kick stuck taskqs to spawn more threads"); -#ifdef HAVE_CPU_HOTPLUG /* * This callback will be called exactly once for each core that comes online, * for each dynamic taskq. We attempt to expand taskqs that have @@ -1369,7 +1362,6 @@ out: spin_unlock_irqrestore(&tq->tq_lock, flags); return (0); } -#endif int spl_taskq_init(void) @@ -1377,10 +1369,8 @@ spl_taskq_init(void) init_rwsem(&tq_list_sem); tsd_create(&taskq_tsd, NULL); -#ifdef HAVE_CPU_HOTPLUG spl_taskq_cpuhp_state = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "fs/spl_taskq:online", spl_taskq_expand, spl_taskq_prepare_down); -#endif system_taskq = taskq_create("spl_system_taskq", MAX(boot_ncpus, 64), maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC); @@ -1390,9 +1380,7 @@ spl_taskq_init(void) system_delay_taskq = taskq_create("spl_delay_taskq", MAX(boot_ncpus, 4), maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC); if (system_delay_taskq == NULL) { -#ifdef HAVE_CPU_HOTPLUG cpuhp_remove_multi_state(spl_taskq_cpuhp_state); -#endif taskq_destroy(system_taskq); return (-ENOMEM); } @@ -1400,9 +1388,7 @@ spl_taskq_init(void) dynamic_taskq = taskq_create("spl_dynamic_taskq", 1, maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE); if (dynamic_taskq == NULL) { -#ifdef HAVE_CPU_HOTPLUG cpuhp_remove_multi_state(spl_taskq_cpuhp_state); -#endif taskq_destroy(system_taskq); taskq_destroy(system_delay_taskq); return (-ENOMEM); @@ -1432,8 +1418,6 @@ spl_taskq_fini(void) tsd_destroy(&taskq_tsd); -#ifdef HAVE_CPU_HOTPLUG cpuhp_remove_multi_state(spl_taskq_cpuhp_state); spl_taskq_cpuhp_state = 0; -#endif }