History

workqueue: Rename workqueue_attrs->no_numa to ->ordered

With the recent removal of NUMA related module param and sysfs knob, workqueue_attrs->no_numa is now only used to implement ordered workqueues. Let's rename the field so that it's less confusing especially with the planned CPU affinity awareness improvements. Just a rename. No functional changes.

Tejun Heo committed 3 years ago

Commit af73f5c1 parent 636b9272 files · +12 −13Browse files

Showing the changes to kernel/workqueue.c (1 of 2 files). Show all

Unified · Split

kernel/workqueue.c+9−10
@@ -3672,10 +3672,10 @@ static void copy_workqueue_attrs(struct workqueue_attrs *to, · 3671 unmodified lines
36723672 cpumask_copy(to->cpumask, from->cpumask);
36733673 /*
36743674 * Unlike hash and equality test, this function doesn't ignore
3675− * ->no_numa as it is used for both pool and wq attrs. Instead,
3676− * get_unbound_pool() explicitly clears ->no_numa after copying.
3675+ * ->ordered as it is used for both pool and wq attrs. Instead,
3676+ * get_unbound_pool() explicitly clears ->ordered after copying.
36773677 */
3678− to->no_numa = from->no_numa;
3678+ to->ordered = from->ordered;
36793679 }
36803680
36813681 /* hash value of the content of @attr */
@@ -3933,10 +3933,10 @@ static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs) · 251 unmodified lines
39333933 pool->node = target_node;
39343934
39353935 /*
3936− * no_numa isn't a worker_pool attribute, always clear it. See
3936+ * ordered isn't a worker_pool attribute, always clear it. See
39373937 * 'struct workqueue_attrs' comments for detail.
39383938 */
3939− pool->attrs->no_numa = false;
3939+ pool->attrs->ordered = false;
39403940
39413941 if (worker_pool_assign_id(pool) < 0)
39423942 goto fail;
@@ -4141,7 +4141,7 @@ static struct pool_workqueue *alloc_unbound_pwq(struct workqueue_struct *wq, · 198 unmodified lines
41414141 static void wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node,
41424142 int cpu_going_down, cpumask_t *cpumask)
41434143 {
4144− if (!wq_numa_enabled || attrs->no_numa)
4144+ if (!wq_numa_enabled || attrs->ordered)
41454145 goto use_dfl;
41464146
41474147 /* does @node have any online CPUs @attrs wants? */
@@ -4253,7 +4253,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, · 105 unmodified lines
42534253 goto out_free;
42544254
42554255 for_each_possible_cpu(cpu) {
4256− if (new_attrs->no_numa) {
4256+ if (new_attrs->ordered) {
42574257 ctx->dfl_pwq->refcnt++;
42584258 ctx->pwq_tbl[cpu] = ctx->dfl_pwq;
42594259 } else {
@@ -4411,7 +4411,7 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, · 151 unmodified lines
44114411 lockdep_assert_held(&wq_pool_mutex);
44124412
44134413 if (!wq_numa_enabled || !(wq->flags & WQ_UNBOUND) ||
4414− wq->unbound_attrs->no_numa)
4414+ wq->unbound_attrs->ordered)
44154415 return;
44164416
44174417 /*
@@ -6358,11 +6358,10 @@ void __init workqueue_init_early(void) · 1940 unmodified lines
63586358 /*
63596359 * An ordered wq should have only one pwq as ordering is
63606360 * guaranteed by max_active which is enforced by pwqs.
6361− * Turn off NUMA so that dfl_pwq is used for all nodes.
63626361 */
63636362 BUG_ON(!(attrs = alloc_workqueue_attrs()));
63646363 attrs->nice = std_nice[i];
6365− attrs->no_numa = true;
6364+ attrs->ordered = true;
63666365 ordered_wq_attrs[i] = attrs;
63676366 }
63686367