Lines Matching refs:attrs

174 	struct workqueue_attrs	*attrs;		/* I: worker attributes */  member
1677 set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask); in worker_attach_to_pool()
1751 pool->attrs->nice < 0 ? "H" : ""); in create_worker()
1760 set_user_nice(worker->task, pool->attrs->nice); in create_worker()
3062 void free_workqueue_attrs(struct workqueue_attrs *attrs) in free_workqueue_attrs() argument
3064 if (attrs) { in free_workqueue_attrs()
3065 free_cpumask_var(attrs->cpumask); in free_workqueue_attrs()
3066 kfree(attrs); in free_workqueue_attrs()
3081 struct workqueue_attrs *attrs; in alloc_workqueue_attrs() local
3083 attrs = kzalloc(sizeof(*attrs), gfp_mask); in alloc_workqueue_attrs()
3084 if (!attrs) in alloc_workqueue_attrs()
3086 if (!alloc_cpumask_var(&attrs->cpumask, gfp_mask)) in alloc_workqueue_attrs()
3089 cpumask_copy(attrs->cpumask, cpu_possible_mask); in alloc_workqueue_attrs()
3090 return attrs; in alloc_workqueue_attrs()
3092 free_workqueue_attrs(attrs); in alloc_workqueue_attrs()
3110 static u32 wqattrs_hash(const struct workqueue_attrs *attrs) in wqattrs_hash() argument
3114 hash = jhash_1word(attrs->nice, hash); in wqattrs_hash()
3115 hash = jhash(cpumask_bits(attrs->cpumask), in wqattrs_hash()
3168 pool->attrs = alloc_workqueue_attrs(GFP_KERNEL); in init_worker_pool()
3169 if (!pool->attrs) in init_worker_pool()
3193 free_workqueue_attrs(pool->attrs); in rcu_free_pool()
3273 static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs) in get_unbound_pool() argument
3275 u32 hash = wqattrs_hash(attrs); in get_unbound_pool()
3283 if (wqattrs_equal(pool->attrs, attrs)) { in get_unbound_pool()
3295 copy_workqueue_attrs(pool->attrs, attrs); in get_unbound_pool()
3301 pool->attrs->no_numa = false; in get_unbound_pool()
3306 if (cpumask_subset(pool->attrs->cpumask, in get_unbound_pool()
3458 const struct workqueue_attrs *attrs) in alloc_unbound_pwq() argument
3465 pool = get_unbound_pool(attrs); in alloc_unbound_pwq()
3501 static bool wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node, in wq_calc_node_cpumask() argument
3504 if (!wq_numa_enabled || attrs->no_numa) in wq_calc_node_cpumask()
3508 cpumask_and(cpumask, cpumask_of_node(node), attrs->cpumask); in wq_calc_node_cpumask()
3516 cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]); in wq_calc_node_cpumask()
3517 return !cpumask_equal(cpumask, attrs->cpumask); in wq_calc_node_cpumask()
3520 cpumask_copy(cpumask, attrs->cpumask); in wq_calc_node_cpumask()
3545 struct workqueue_attrs *attrs; /* attrs to apply */ member
3560 free_workqueue_attrs(ctx->attrs); in apply_wqattrs_cleanup()
3569 const struct workqueue_attrs *attrs) in apply_wqattrs_prepare() argument
3586 copy_workqueue_attrs(new_attrs, attrs); in apply_wqattrs_prepare()
3606 if (wq_calc_node_cpumask(attrs, node, -1, tmp_attrs->cpumask)) { in apply_wqattrs_prepare()
3616 ctx->attrs = new_attrs; in apply_wqattrs_prepare()
3636 copy_workqueue_attrs(ctx->wq->unbound_attrs, ctx->attrs); in apply_wqattrs_commit()
3667 const struct workqueue_attrs *attrs) in apply_workqueue_attrs() argument
3688 ctx = apply_wqattrs_prepare(wq, attrs); in apply_workqueue_attrs()
3762 if (cpumask_equal(cpumask, pwq->pool->attrs->cpumask)) in wq_update_unbound_numa()
4229 pr_cont(" cpus=%*pbl", nr_cpumask_bits, pool->attrs->cpumask); in pr_cont_pool_info()
4232 pr_cont(" flags=0x%x nice=%d", pool->flags, pool->attrs->nice); in pr_cont_pool_info()
4477 pool->attrs->cpumask) < 0); in rebind_workers()
4549 if (!cpumask_test_cpu(cpu, pool->attrs->cpumask)) in restore_unbound_workers_cpumask()
4553 cpumask_and(&cpumask, pool->attrs->cpumask, cpu_online_mask); in restore_unbound_workers_cpumask()
4560 pool->attrs->cpumask) < 0); in restore_unbound_workers_cpumask()
4897 struct workqueue_attrs *attrs; in wq_sysfs_prep_attrs() local
4899 attrs = alloc_workqueue_attrs(GFP_KERNEL); in wq_sysfs_prep_attrs()
4900 if (!attrs) in wq_sysfs_prep_attrs()
4904 copy_workqueue_attrs(attrs, wq->unbound_attrs); in wq_sysfs_prep_attrs()
4906 return attrs; in wq_sysfs_prep_attrs()
4913 struct workqueue_attrs *attrs; in wq_nice_store() local
4916 attrs = wq_sysfs_prep_attrs(wq); in wq_nice_store()
4917 if (!attrs) in wq_nice_store()
4920 if (sscanf(buf, "%d", &attrs->nice) == 1 && in wq_nice_store()
4921 attrs->nice >= MIN_NICE && attrs->nice <= MAX_NICE) in wq_nice_store()
4922 ret = apply_workqueue_attrs(wq, attrs); in wq_nice_store()
4926 free_workqueue_attrs(attrs); in wq_nice_store()
4948 struct workqueue_attrs *attrs; in wq_cpumask_store() local
4951 attrs = wq_sysfs_prep_attrs(wq); in wq_cpumask_store()
4952 if (!attrs) in wq_cpumask_store()
4955 ret = cpumask_parse(buf, attrs->cpumask); in wq_cpumask_store()
4957 ret = apply_workqueue_attrs(wq, attrs); in wq_cpumask_store()
4959 free_workqueue_attrs(attrs); in wq_cpumask_store()
4981 struct workqueue_attrs *attrs; in wq_numa_store() local
4984 attrs = wq_sysfs_prep_attrs(wq); in wq_numa_store()
4985 if (!attrs) in wq_numa_store()
4990 attrs->no_numa = !v; in wq_numa_store()
4991 ret = apply_workqueue_attrs(wq, attrs); in wq_numa_store()
4994 free_workqueue_attrs(attrs); in wq_numa_store()
5176 cpumask_copy(pool->attrs->cpumask, cpumask_of(cpu)); in init_workqueues()
5177 pool->attrs->nice = std_nice[i++]; in init_workqueues()
5199 struct workqueue_attrs *attrs; in init_workqueues() local
5201 BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); in init_workqueues()
5202 attrs->nice = std_nice[i]; in init_workqueues()
5203 unbound_std_wq_attrs[i] = attrs; in init_workqueues()
5210 BUG_ON(!(attrs = alloc_workqueue_attrs(GFP_KERNEL))); in init_workqueues()
5211 attrs->nice = std_nice[i]; in init_workqueues()
5212 attrs->no_numa = true; in init_workqueues()
5213 ordered_wq_attrs[i] = attrs; in init_workqueues()