• Home
  • Raw
  • Download

Lines Matching refs:ctx

3965 static void apply_wqattrs_cleanup(struct apply_wqattrs_ctx *ctx)  in apply_wqattrs_cleanup()  argument
3967 if (ctx) { in apply_wqattrs_cleanup()
3971 put_pwq_unlocked(ctx->pwq_tbl[node]); in apply_wqattrs_cleanup()
3972 put_pwq_unlocked(ctx->dfl_pwq); in apply_wqattrs_cleanup()
3974 free_workqueue_attrs(ctx->attrs); in apply_wqattrs_cleanup()
3976 kfree(ctx); in apply_wqattrs_cleanup()
3985 struct apply_wqattrs_ctx *ctx; in apply_wqattrs_prepare() local
3991 ctx = kzalloc(struct_size(ctx, pwq_tbl, nr_node_ids), GFP_KERNEL); in apply_wqattrs_prepare()
3995 if (!ctx || !new_attrs || !tmp_attrs) in apply_wqattrs_prepare()
4020 ctx->dfl_pwq = alloc_unbound_pwq(wq, new_attrs); in apply_wqattrs_prepare()
4021 if (!ctx->dfl_pwq) in apply_wqattrs_prepare()
4026 ctx->pwq_tbl[node] = alloc_unbound_pwq(wq, tmp_attrs); in apply_wqattrs_prepare()
4027 if (!ctx->pwq_tbl[node]) in apply_wqattrs_prepare()
4030 ctx->dfl_pwq->refcnt++; in apply_wqattrs_prepare()
4031 ctx->pwq_tbl[node] = ctx->dfl_pwq; in apply_wqattrs_prepare()
4038 ctx->attrs = new_attrs; in apply_wqattrs_prepare()
4040 ctx->wq = wq; in apply_wqattrs_prepare()
4042 return ctx; in apply_wqattrs_prepare()
4047 apply_wqattrs_cleanup(ctx); in apply_wqattrs_prepare()
4052 static void apply_wqattrs_commit(struct apply_wqattrs_ctx *ctx) in apply_wqattrs_commit() argument
4057 mutex_lock(&ctx->wq->mutex); in apply_wqattrs_commit()
4059 copy_workqueue_attrs(ctx->wq->unbound_attrs, ctx->attrs); in apply_wqattrs_commit()
4063 ctx->pwq_tbl[node] = numa_pwq_tbl_install(ctx->wq, node, in apply_wqattrs_commit()
4064 ctx->pwq_tbl[node]); in apply_wqattrs_commit()
4067 link_pwq(ctx->dfl_pwq); in apply_wqattrs_commit()
4068 swap(ctx->wq->dfl_pwq, ctx->dfl_pwq); in apply_wqattrs_commit()
4070 mutex_unlock(&ctx->wq->mutex); in apply_wqattrs_commit()
4089 struct apply_wqattrs_ctx *ctx; in apply_workqueue_attrs_locked() local
4103 ctx = apply_wqattrs_prepare(wq, attrs); in apply_workqueue_attrs_locked()
4104 if (!ctx) in apply_workqueue_attrs_locked()
4108 apply_wqattrs_commit(ctx); in apply_workqueue_attrs_locked()
4109 apply_wqattrs_cleanup(ctx); in apply_workqueue_attrs_locked()
5392 struct apply_wqattrs_ctx *ctx, *n; in workqueue_apply_unbound_cpumask() local
5407 ctx = apply_wqattrs_prepare(wq, wq->unbound_attrs); in workqueue_apply_unbound_cpumask()
5408 if (!ctx) { in workqueue_apply_unbound_cpumask()
5413 list_add_tail(&ctx->list, &ctxs); in workqueue_apply_unbound_cpumask()
5416 list_for_each_entry_safe(ctx, n, &ctxs, list) { in workqueue_apply_unbound_cpumask()
5418 apply_wqattrs_commit(ctx); in workqueue_apply_unbound_cpumask()
5419 apply_wqattrs_cleanup(ctx); in workqueue_apply_unbound_cpumask()