|
@@ -940,6 +940,8 @@ static struct kobj_type padata_attr_type = {
|
|
* @wq: workqueue to use for the allocated padata instance
|
|
* @wq: workqueue to use for the allocated padata instance
|
|
* @pcpumask: cpumask that will be used for padata parallelization
|
|
* @pcpumask: cpumask that will be used for padata parallelization
|
|
* @cbcpumask: cpumask that will be used for padata serialization
|
|
* @cbcpumask: cpumask that will be used for padata serialization
|
|
|
|
+ *
|
|
|
|
+ * Must be called from a cpus_read_lock() protected region
|
|
*/
|
|
*/
|
|
static struct padata_instance *padata_alloc(struct workqueue_struct *wq,
|
|
static struct padata_instance *padata_alloc(struct workqueue_struct *wq,
|
|
const struct cpumask *pcpumask,
|
|
const struct cpumask *pcpumask,
|
|
@@ -952,7 +954,6 @@ static struct padata_instance *padata_alloc(struct workqueue_struct *wq,
|
|
if (!pinst)
|
|
if (!pinst)
|
|
goto err;
|
|
goto err;
|
|
|
|
|
|
- get_online_cpus();
|
|
|
|
if (!alloc_cpumask_var(&pinst->cpumask.pcpu, GFP_KERNEL))
|
|
if (!alloc_cpumask_var(&pinst->cpumask.pcpu, GFP_KERNEL))
|
|
goto err_free_inst;
|
|
goto err_free_inst;
|
|
if (!alloc_cpumask_var(&pinst->cpumask.cbcpu, GFP_KERNEL)) {
|
|
if (!alloc_cpumask_var(&pinst->cpumask.cbcpu, GFP_KERNEL)) {
|
|
@@ -976,14 +977,12 @@ static struct padata_instance *padata_alloc(struct workqueue_struct *wq,
|
|
|
|
|
|
pinst->flags = 0;
|
|
pinst->flags = 0;
|
|
|
|
|
|
- put_online_cpus();
|
|
|
|
-
|
|
|
|
BLOCKING_INIT_NOTIFIER_HEAD(&pinst->cpumask_change_notifier);
|
|
BLOCKING_INIT_NOTIFIER_HEAD(&pinst->cpumask_change_notifier);
|
|
kobject_init(&pinst->kobj, &padata_attr_type);
|
|
kobject_init(&pinst->kobj, &padata_attr_type);
|
|
mutex_init(&pinst->lock);
|
|
mutex_init(&pinst->lock);
|
|
|
|
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
#ifdef CONFIG_HOTPLUG_CPU
|
|
- cpuhp_state_add_instance_nocalls(hp_online, &pinst->node);
|
|
|
|
|
|
+ cpuhp_state_add_instance_nocalls_cpuslocked(hp_online, &pinst->node);
|
|
#endif
|
|
#endif
|
|
return pinst;
|
|
return pinst;
|
|
|
|
|
|
@@ -992,7 +991,6 @@ err_free_masks:
|
|
free_cpumask_var(pinst->cpumask.cbcpu);
|
|
free_cpumask_var(pinst->cpumask.cbcpu);
|
|
err_free_inst:
|
|
err_free_inst:
|
|
kfree(pinst);
|
|
kfree(pinst);
|
|
- put_online_cpus();
|
|
|
|
err:
|
|
err:
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
@@ -1003,9 +1001,12 @@ err:
|
|
* parallel workers.
|
|
* parallel workers.
|
|
*
|
|
*
|
|
* @wq: workqueue to use for the allocated padata instance
|
|
* @wq: workqueue to use for the allocated padata instance
|
|
|
|
+ *
|
|
|
|
+ * Must be called from a cpus_read_lock() protected region
|
|
*/
|
|
*/
|
|
struct padata_instance *padata_alloc_possible(struct workqueue_struct *wq)
|
|
struct padata_instance *padata_alloc_possible(struct workqueue_struct *wq)
|
|
{
|
|
{
|
|
|
|
+ lockdep_assert_cpus_held();
|
|
return padata_alloc(wq, cpu_possible_mask, cpu_possible_mask);
|
|
return padata_alloc(wq, cpu_possible_mask, cpu_possible_mask);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(padata_alloc_possible);
|
|
EXPORT_SYMBOL(padata_alloc_possible);
|