Lines Matching refs:attrs
188 struct workqueue_attrs *attrs; /* I: worker attributes */ member
1886 set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask); in worker_attach_to_pool()
1955 pool->attrs->nice < 0 ? "H" : ""); in create_worker()
1964 set_user_nice(worker->task, pool->attrs->nice); in create_worker()
1965 kthread_bind_mask(worker->task, pool->attrs->cpumask); in create_worker()
3384 void free_workqueue_attrs(struct workqueue_attrs *attrs) in free_workqueue_attrs() argument
3386 if (attrs) { in free_workqueue_attrs()
3387 free_cpumask_var(attrs->cpumask); in free_workqueue_attrs()
3388 kfree(attrs); in free_workqueue_attrs()
3402 struct workqueue_attrs *attrs; in alloc_workqueue_attrs() local
3404 attrs = kzalloc(sizeof(*attrs), GFP_KERNEL); in alloc_workqueue_attrs()
3405 if (!attrs) in alloc_workqueue_attrs()
3407 if (!alloc_cpumask_var(&attrs->cpumask, GFP_KERNEL)) in alloc_workqueue_attrs()
3410 cpumask_copy(attrs->cpumask, cpu_possible_mask); in alloc_workqueue_attrs()
3411 return attrs; in alloc_workqueue_attrs()
3413 free_workqueue_attrs(attrs); in alloc_workqueue_attrs()
3431 static u32 wqattrs_hash(const struct workqueue_attrs *attrs) in wqattrs_hash() argument
3435 hash = jhash_1word(attrs->nice, hash); in wqattrs_hash()
3436 hash = jhash(cpumask_bits(attrs->cpumask), in wqattrs_hash()
3485 pool->attrs = alloc_workqueue_attrs(); in init_worker_pool()
3486 if (!pool->attrs) in init_worker_pool()
3549 free_workqueue_attrs(pool->attrs); in rcu_free_pool()
3642 static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs) in get_unbound_pool() argument
3644 u32 hash = wqattrs_hash(attrs); in get_unbound_pool()
3653 if (wqattrs_equal(pool->attrs, attrs)) { in get_unbound_pool()
3662 if (cpumask_subset(attrs->cpumask, in get_unbound_pool()
3676 copy_workqueue_attrs(pool->attrs, attrs); in get_unbound_pool()
3683 pool->attrs->no_numa = false; in get_unbound_pool()
3846 const struct workqueue_attrs *attrs) in alloc_unbound_pwq() argument
3853 pool = get_unbound_pool(attrs); in alloc_unbound_pwq()
3889 static bool wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node, in wq_calc_node_cpumask() argument
3892 if (!wq_numa_enabled || attrs->no_numa) in wq_calc_node_cpumask()
3896 cpumask_and(cpumask, cpumask_of_node(node), attrs->cpumask); in wq_calc_node_cpumask()
3904 cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]); in wq_calc_node_cpumask()
3912 return !cpumask_equal(cpumask, attrs->cpumask); in wq_calc_node_cpumask()
3915 cpumask_copy(cpumask, attrs->cpumask); in wq_calc_node_cpumask()
3940 struct workqueue_attrs *attrs; /* attrs to apply */ member
3956 free_workqueue_attrs(ctx->attrs); in apply_wqattrs_cleanup()
3965 const struct workqueue_attrs *attrs, in apply_wqattrs_prepare() argument
3987 copy_workqueue_attrs(new_attrs, attrs); in apply_wqattrs_prepare()
4020 copy_workqueue_attrs(new_attrs, attrs); in apply_wqattrs_prepare()
4022 ctx->attrs = new_attrs; in apply_wqattrs_prepare()
4043 copy_workqueue_attrs(ctx->wq->unbound_attrs, ctx->attrs); in apply_wqattrs_commit()
4071 const struct workqueue_attrs *attrs) in apply_workqueue_attrs_locked() argument
4087 ctx = apply_wqattrs_prepare(wq, attrs, wq_unbound_cpumask); in apply_workqueue_attrs_locked()
4117 const struct workqueue_attrs *attrs) in apply_workqueue_attrs() argument
4124 ret = apply_workqueue_attrs_locked(wq, attrs); in apply_workqueue_attrs()
4184 if (wq_calc_node_cpumask(wq->dfl_pwq->pool->attrs, node, cpu_off, cpumask)) { in wq_update_unbound_numa()
4185 if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask)) in wq_update_unbound_numa()
4718 pr_cont(" cpus=%*pbl", nr_cpumask_bits, pool->attrs->cpumask); in pr_cont_pool_info()
4721 pr_cont(" flags=0x%x nice=%d", pool->flags, pool->attrs->nice); in pr_cont_pool_info()
5060 pool->attrs->cpumask) < 0); in rebind_workers()
5112 if (!cpumask_test_cpu(cpu, pool->attrs->cpumask)) in restore_unbound_workers_cpumask()
5115 cpumask_and(&cpumask, pool->attrs->cpumask, cpu_online_mask); in restore_unbound_workers_cpumask()
5539 struct workqueue_attrs *attrs; in wq_sysfs_prep_attrs() local
5543 attrs = alloc_workqueue_attrs(); in wq_sysfs_prep_attrs()
5544 if (!attrs) in wq_sysfs_prep_attrs()
5547 copy_workqueue_attrs(attrs, wq->unbound_attrs); in wq_sysfs_prep_attrs()
5548 return attrs; in wq_sysfs_prep_attrs()
5555 struct workqueue_attrs *attrs; in wq_nice_store() local
5560 attrs = wq_sysfs_prep_attrs(wq); in wq_nice_store()
5561 if (!attrs) in wq_nice_store()
5564 if (sscanf(buf, "%d", &attrs->nice) == 1 && in wq_nice_store()
5565 attrs->nice >= MIN_NICE && attrs->nice <= MAX_NICE) in wq_nice_store()
5566 ret = apply_workqueue_attrs_locked(wq, attrs); in wq_nice_store()
5572 free_workqueue_attrs(attrs); in wq_nice_store()
5594 struct workqueue_attrs *attrs; in wq_cpumask_store() local
5599 attrs = wq_sysfs_prep_attrs(wq); in wq_cpumask_store()
5600 if (!attrs) in wq_cpumask_store()
5603 ret = cpumask_parse(buf, attrs->cpumask); in wq_cpumask_store()
5605 ret = apply_workqueue_attrs_locked(wq, attrs); in wq_cpumask_store()
5609 free_workqueue_attrs(attrs); in wq_cpumask_store()
5631 struct workqueue_attrs *attrs; in wq_numa_store() local
5636 attrs = wq_sysfs_prep_attrs(wq); in wq_numa_store()
5637 if (!attrs) in wq_numa_store()
5642 attrs->no_numa = !v; in wq_numa_store()
5643 ret = apply_workqueue_attrs_locked(wq, attrs); in wq_numa_store()
5648 free_workqueue_attrs(attrs); in wq_numa_store()
6030 cpumask_copy(pool->attrs->cpumask, cpumask_of(cpu)); in workqueue_init_early()
6031 pool->attrs->nice = std_nice[i++]; in workqueue_init_early()
6043 struct workqueue_attrs *attrs; in workqueue_init_early() local
6045 BUG_ON(!(attrs = alloc_workqueue_attrs())); in workqueue_init_early()
6046 attrs->nice = std_nice[i]; in workqueue_init_early()
6047 unbound_std_wq_attrs[i] = attrs; in workqueue_init_early()
6054 BUG_ON(!(attrs = alloc_workqueue_attrs())); in workqueue_init_early()
6055 attrs->nice = std_nice[i]; in workqueue_init_early()
6056 attrs->no_numa = true; in workqueue_init_early()
6057 ordered_wq_attrs[i] = attrs; in workqueue_init_early()