mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-02-12 10:21:12 +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:
parent
f32d5cf3c2
commit
7bdea98d4f
@ -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)
|
|
||||||
])
|
|
||||||
])
|
|
@ -124,7 +124,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
|
||||||
@ -259,7 +258,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
|
||||||
|
@ -28,9 +28,7 @@
|
|||||||
#include <sys/kmem.h>
|
#include <sys/kmem.h>
|
||||||
#include <sys/tsd.h>
|
#include <sys/tsd.h>
|
||||||
#include <sys/trace_spl.h>
|
#include <sys/trace_spl.h>
|
||||||
#ifdef HAVE_CPU_HOTPLUG
|
|
||||||
#include <linux/cpuhotplug.h>
|
#include <linux/cpuhotplug.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
static int spl_taskq_thread_bind = 0;
|
static int spl_taskq_thread_bind = 0;
|
||||||
module_param(spl_taskq_thread_bind, int, 0644);
|
module_param(spl_taskq_thread_bind, int, 0644);
|
||||||
@ -74,10 +72,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);
|
||||||
@ -1068,7 +1064,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,
|
||||||
@ -1077,7 +1073,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);
|
||||||
@ -1162,12 +1157,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.
|
||||||
@ -1291,7 +1285,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
|
||||||
@ -1369,7 +1362,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)
|
||||||
@ -1377,10 +1369,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);
|
||||||
@ -1390,9 +1380,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);
|
||||||
}
|
}
|
||||||
@ -1400,9 +1388,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);
|
||||||
@ -1432,8 +1418,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
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user