Lines Matching refs:attrs

174 	struct workqueue_attrs	*attrs;		/* I: worker attributes */  member
1672 set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask); in worker_attach_to_pool()
1746 pool->attrs->nice < 0 ? "H" : ""); in create_worker()
1755 set_user_nice(worker->task, pool->attrs->nice); in create_worker()
1756 kthread_bind_mask(worker->task, pool->attrs->cpumask); in create_worker()
3025 void free_workqueue_attrs(struct workqueue_attrs *attrs) in free_workqueue_attrs() argument
3027 if (attrs) { in free_workqueue_attrs()
3028 free_cpumask_var(attrs->cpumask); in free_workqueue_attrs()
3029 kfree(attrs); in free_workqueue_attrs()
3044 struct workqueue_attrs *attrs; in alloc_workqueue_attrs() local
3046 attrs = kzalloc(sizeof(*attrs), gfp_mask); in alloc_workqueue_attrs()
3047 if (!attrs) in alloc_workqueue_attrs()
3049 if (!alloc_cpumask_var(&attrs->cpumask, gfp_mask)) in alloc_workqueue_attrs()
3052 cpumask_copy(attrs->cpumask, cpu_possible_mask); in alloc_workqueue_attrs()
3053 return attrs; in alloc_workqueue_attrs()
3055 free_workqueue_attrs(attrs); in alloc_workqueue_attrs()
3073 static u32 wqattrs_hash(const struct workqueue_attrs *attrs) in wqattrs_hash() argument
3077 hash = jhash_1word(attrs->nice, hash); in wqattrs_hash()
3078 hash = jhash(cpumask_bits(attrs->cpumask), in wqattrs_hash()
3131 pool->attrs = alloc_workqueue_attrs(GFP_KERNEL); in init_worker_pool()
3132 if (!pool->attrs) in init_worker_pool()
3156 free_workqueue_attrs(pool->attrs); in rcu_free_pool()
3236 static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs) in get_unbound_pool() argument
3238 u32 hash = wqattrs_hash(attrs); in get_unbound_pool()
3247 if (wqattrs_equal(pool->attrs, attrs)) { in get_unbound_pool()
3256 if (cpumask_subset(attrs->cpumask, in get_unbound_pool()
3270 copy_workqueue_attrs(pool->attrs, attrs); in get_unbound_pool()
3277 pool->attrs->no_numa = false; in get_unbound_pool()
3423 const struct workqueue_attrs *attrs) in alloc_unbound_pwq() argument
3430 pool = get_unbound_pool(attrs); in alloc_unbound_pwq()
3466 static bool wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node, in wq_calc_node_cpumask() argument
3469 if (!wq_numa_enabled || attrs->no_numa) in wq_calc_node_cpumask()
3473 cpumask_and(cpumask, cpumask_of_node(node), attrs->cpumask); in wq_calc_node_cpumask()
3481 cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]); in wq_calc_node_cpumask()
3482 return !cpumask_equal(cpumask, attrs->cpumask); in wq_calc_node_cpumask()
3485 cpumask_copy(cpumask, attrs->cpumask); in wq_calc_node_cpumask()
3510 struct workqueue_attrs *attrs; /* attrs to apply */ member
3526 free_workqueue_attrs(ctx->attrs); in apply_wqattrs_cleanup()
3535 const struct workqueue_attrs *attrs) in apply_wqattrs_prepare() argument
3556 copy_workqueue_attrs(new_attrs, attrs); in apply_wqattrs_prepare()
3589 copy_workqueue_attrs(new_attrs, attrs); in apply_wqattrs_prepare()
3591 ctx->attrs = new_attrs; in apply_wqattrs_prepare()
3612 copy_workqueue_attrs(ctx->wq->unbound_attrs, ctx->attrs); in apply_wqattrs_commit()
3640 const struct workqueue_attrs *attrs) in apply_workqueue_attrs_locked() argument
3653 ctx = apply_wqattrs_prepare(wq, attrs); in apply_workqueue_attrs_locked()
3683 const struct workqueue_attrs *attrs) in apply_workqueue_attrs() argument
3688 ret = apply_workqueue_attrs_locked(wq, attrs); in apply_workqueue_attrs()
3748 if (wq_calc_node_cpumask(wq->dfl_pwq->pool->attrs, node, cpu_off, cpumask)) { in wq_update_unbound_numa()
3749 if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask)) in wq_update_unbound_numa()
4209 pr_cont(" cpus=%*pbl", nr_cpumask_bits, pool->attrs->cpumask); in pr_cont_pool_info()
4212 pr_cont(" flags=0x%x nice=%d", pool->flags, pool->attrs->nice); in pr_cont_pool_info()
4457 pool->attrs->cpumask) < 0); in rebind_workers()
4529 if (!cpumask_test_cpu(cpu, pool->attrs->cpumask)) in restore_unbound_workers_cpumask()
4533 cpumask_and(&cpumask, pool->attrs->cpumask, cpu_online_mask); in restore_unbound_workers_cpumask()
4540 pool->attrs->cpumask) < 0); in restore_unbound_workers_cpumask()
4953 struct workqueue_attrs *attrs; in wq_sysfs_prep_attrs() local
4957 attrs = alloc_workqueue_attrs(GFP_KERNEL); in wq_sysfs_prep_attrs()
4958 if (!attrs) in wq_sysfs_prep_attrs()
4961 copy_workqueue_attrs(attrs, wq->unbound_attrs); in wq_sysfs_prep_attrs()
4962 return attrs; in wq_sysfs_prep_attrs()
4969 struct workqueue_attrs *attrs; in wq_nice_store() local
4974 attrs = wq_sysfs_prep_attrs(wq); in wq_nice_store()
4975 if (!attrs) in wq_nice_store()
4978 if (sscanf(buf, "%d", &attrs->nice) == 1 && in wq_nice_store()
4979 attrs->nice >= MIN_NICE && attrs->nice <= MAX_NICE) in wq_nice_store()
4980 ret = apply_workqueue_attrs_locked(wq, attrs); in wq_nice_store()
4986 free_workqueue_attrs(attrs); in wq_nice_store()
5008 struct workqueue_attrs *attrs; in wq_cpumask_store() local
5013 attrs = wq_sysfs_prep_attrs(wq); in wq_cpumask_store()
5014 if (!attrs) in wq_cpumask_store()
5017 ret = cpumask_parse(buf, attrs->cpumask); in wq_cpumask_store()
5019 ret = apply_workqueue_attrs_locked(wq, attrs); in wq_cpumask_store()
5023 free_workqueue_attrs(attrs); in wq_cpumask_store()
5045 struct workqueue_attrs *attrs; in wq_numa_store() local
5050 attrs = wq_sysfs_prep_attrs(wq); in wq_numa_store()
5051 if (!attrs) in wq_numa_store()
5056 attrs->no_numa = !v; in wq_numa_store()
5057 ret = apply_workqueue_attrs_locked(wq, attrs); in wq_numa_store()
5062 free_workqueue_attrs(attrs); in wq_numa_store()
5287 cpumask_copy(pool->attrs->cpumask, cpumask_of(cpu)); in init_workqueues()
5288 pool->attrs->nice = std_nice[i++]; in init_workqueues()
5310 struct workqueue_attrs *attrs; in init_workqueues() local
5312 BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); in init_workqueues()
5313 attrs->nice = std_nice[i]; in init_workqueues()
5314 unbound_std_wq_attrs[i] = attrs; in init_workqueues()
5321 BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); in init_workqueues()
5322 attrs->nice = std_nice[i]; in init_workqueues()
5323 attrs->no_numa = true; in init_workqueues()
5324 ordered_wq_attrs[i] = attrs; in init_workqueues()