config: remove HAVE_CPU_HOTPLUG

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16479
This commit is contained in:
Rob Norris 2024-08-16 16:25:17 +10:00 committed by Brian Behlendorf
parent ddf5122a29
commit bbc52ed501
3 changed files with 2 additions and 46 deletions

View File

@ -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 <linux/cpuhotplug.h>
],[
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)
])
])

View File

@ -126,7 +126,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
ZFS_AC_KERNEL_SRC_TOTALRAM_PAGES_FUNC ZFS_AC_KERNEL_SRC_TOTALRAM_PAGES_FUNC
ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES
ZFS_AC_KERNEL_SRC_PERCPU ZFS_AC_KERNEL_SRC_PERCPU
ZFS_AC_KERNEL_SRC_CPU_HOTPLUG
ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR
ZFS_AC_KERNEL_SRC_MKNOD ZFS_AC_KERNEL_SRC_MKNOD
ZFS_AC_KERNEL_SRC_SYMLINK ZFS_AC_KERNEL_SRC_SYMLINK
@ -263,7 +262,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
ZFS_AC_KERNEL_TOTALRAM_PAGES_FUNC ZFS_AC_KERNEL_TOTALRAM_PAGES_FUNC
ZFS_AC_KERNEL_TOTALHIGH_PAGES ZFS_AC_KERNEL_TOTALHIGH_PAGES
ZFS_AC_KERNEL_PERCPU ZFS_AC_KERNEL_PERCPU
ZFS_AC_KERNEL_CPU_HOTPLUG
ZFS_AC_KERNEL_GENERIC_FILLATTR ZFS_AC_KERNEL_GENERIC_FILLATTR
ZFS_AC_KERNEL_MKNOD ZFS_AC_KERNEL_MKNOD
ZFS_AC_KERNEL_SYMLINK ZFS_AC_KERNEL_SYMLINK

View File

@ -35,9 +35,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/atomic.h> #include <sys/atomic.h>
#include <sys/kstat.h> #include <sys/kstat.h>
#ifdef HAVE_CPU_HOTPLUG
#include <linux/cpuhotplug.h> #include <linux/cpuhotplug.h>
#endif
typedef struct taskq_kstats { typedef struct taskq_kstats {
/* static values, for completeness */ /* static values, for completeness */
@ -156,10 +154,8 @@ EXPORT_SYMBOL(system_delay_taskq);
static taskq_t *dynamic_taskq; static taskq_t *dynamic_taskq;
static taskq_thread_t *taskq_thread_create(taskq_t *); static taskq_thread_t *taskq_thread_create(taskq_t *);
#ifdef HAVE_CPU_HOTPLUG
/* Multi-callback id for cpu hotplugging. */ /* Multi-callback id for cpu hotplugging. */
static int spl_taskq_cpuhp_state; static int spl_taskq_cpuhp_state;
#endif
/* List of all taskqs */ /* List of all taskqs */
LIST_HEAD(tq_list); LIST_HEAD(tq_list);
@ -1349,7 +1345,7 @@ taskq_create(const char *name, int threads_arg, pri_t pri,
return (NULL); return (NULL);
tq->tq_hp_support = B_FALSE; tq->tq_hp_support = B_FALSE;
#ifdef HAVE_CPU_HOTPLUG
if (flags & TASKQ_THREADS_CPU_PCT) { if (flags & TASKQ_THREADS_CPU_PCT) {
tq->tq_hp_support = B_TRUE; tq->tq_hp_support = B_TRUE;
if (cpuhp_state_add_instance_nocalls(spl_taskq_cpuhp_state, if (cpuhp_state_add_instance_nocalls(spl_taskq_cpuhp_state,
@ -1358,7 +1354,6 @@ taskq_create(const char *name, int threads_arg, pri_t pri,
return (NULL); return (NULL);
} }
} }
#endif
spin_lock_init(&tq->tq_lock); spin_lock_init(&tq->tq_lock);
INIT_LIST_HEAD(&tq->tq_thread_list); INIT_LIST_HEAD(&tq->tq_thread_list);
@ -1447,12 +1442,11 @@ taskq_destroy(taskq_t *tq)
tq->tq_flags &= ~TASKQ_ACTIVE; tq->tq_flags &= ~TASKQ_ACTIVE;
spin_unlock_irqrestore(&tq->tq_lock, flags); spin_unlock_irqrestore(&tq->tq_lock, flags);
#ifdef HAVE_CPU_HOTPLUG
if (tq->tq_hp_support) { if (tq->tq_hp_support) {
VERIFY0(cpuhp_state_remove_instance_nocalls( VERIFY0(cpuhp_state_remove_instance_nocalls(
spl_taskq_cpuhp_state, &tq->tq_hp_cb_node)); spl_taskq_cpuhp_state, &tq->tq_hp_cb_node));
} }
#endif
/* /*
* When TASKQ_ACTIVE is clear new tasks may not be added nor may * When TASKQ_ACTIVE is clear new tasks may not be added nor may
* new worker threads be spawned for dynamic taskq. * new worker threads be spawned for dynamic taskq.
@ -1709,7 +1703,6 @@ module_param_call(spl_taskq_kick, param_set_taskq_kick, param_get_uint,
MODULE_PARM_DESC(spl_taskq_kick, MODULE_PARM_DESC(spl_taskq_kick,
"Write nonzero to kick stuck taskqs to spawn more threads"); "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, * This callback will be called exactly once for each core that comes online,
* for each dynamic taskq. We attempt to expand taskqs that have * for each dynamic taskq. We attempt to expand taskqs that have
@ -1787,7 +1780,6 @@ out:
spin_unlock_irqrestore(&tq->tq_lock, flags); spin_unlock_irqrestore(&tq->tq_lock, flags);
return (0); return (0);
} }
#endif
int int
spl_taskq_init(void) spl_taskq_init(void)
@ -1795,10 +1787,8 @@ spl_taskq_init(void)
init_rwsem(&tq_list_sem); init_rwsem(&tq_list_sem);
tsd_create(&taskq_tsd, NULL); tsd_create(&taskq_tsd, NULL);
#ifdef HAVE_CPU_HOTPLUG
spl_taskq_cpuhp_state = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, spl_taskq_cpuhp_state = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN,
"fs/spl_taskq:online", spl_taskq_expand, spl_taskq_prepare_down); "fs/spl_taskq:online", spl_taskq_expand, spl_taskq_prepare_down);
#endif
system_taskq = taskq_create("spl_system_taskq", MAX(boot_ncpus, 64), system_taskq = taskq_create("spl_system_taskq", MAX(boot_ncpus, 64),
maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC); maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC);
@ -1808,9 +1798,7 @@ spl_taskq_init(void)
system_delay_taskq = taskq_create("spl_delay_taskq", MAX(boot_ncpus, 4), system_delay_taskq = taskq_create("spl_delay_taskq", MAX(boot_ncpus, 4),
maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC); maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE|TASKQ_DYNAMIC);
if (system_delay_taskq == NULL) { if (system_delay_taskq == NULL) {
#ifdef HAVE_CPU_HOTPLUG
cpuhp_remove_multi_state(spl_taskq_cpuhp_state); cpuhp_remove_multi_state(spl_taskq_cpuhp_state);
#endif
taskq_destroy(system_taskq); taskq_destroy(system_taskq);
return (-ENOMEM); return (-ENOMEM);
} }
@ -1818,9 +1806,7 @@ spl_taskq_init(void)
dynamic_taskq = taskq_create("spl_dynamic_taskq", 1, dynamic_taskq = taskq_create("spl_dynamic_taskq", 1,
maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE); maxclsyspri, boot_ncpus, INT_MAX, TASKQ_PREPOPULATE);
if (dynamic_taskq == NULL) { if (dynamic_taskq == NULL) {
#ifdef HAVE_CPU_HOTPLUG
cpuhp_remove_multi_state(spl_taskq_cpuhp_state); cpuhp_remove_multi_state(spl_taskq_cpuhp_state);
#endif
taskq_destroy(system_taskq); taskq_destroy(system_taskq);
taskq_destroy(system_delay_taskq); taskq_destroy(system_delay_taskq);
return (-ENOMEM); return (-ENOMEM);
@ -1854,8 +1840,6 @@ spl_taskq_fini(void)
tsd_destroy(&taskq_tsd); tsd_destroy(&taskq_tsd);
#ifdef HAVE_CPU_HOTPLUG
cpuhp_remove_multi_state(spl_taskq_cpuhp_state); cpuhp_remove_multi_state(spl_taskq_cpuhp_state);
spl_taskq_cpuhp_state = 0; spl_taskq_cpuhp_state = 0;
#endif
} }