mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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:
@@ -28,9 +28,7 @@
|
||||
#include <sys/kmem.h>
|
||||
#include <sys/tsd.h>
|
||||
#include <sys/trace_spl.h>
|
||||
#ifdef HAVE_CPU_HOTPLUG
|
||||
#include <linux/cpuhotplug.h>
|
||||
#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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user