Skip to content

Commit af73f5c

Browse files
committed
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. Signed-off-by: Tejun Heo <[email protected]>
1 parent 636b927 commit af73f5c

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

include/linux/workqueue.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ struct workqueue_attrs {
142142
cpumask_var_t cpumask;
143143

144144
/**
145-
* @no_numa: disable NUMA affinity
145+
* @ordered: work items must be executed one by one in queueing order
146146
*
147-
* Unlike other fields, ``no_numa`` isn't a property of a worker_pool. It
147+
* Unlike other fields, ``ordered`` isn't a property of a worker_pool. It
148148
* only modifies how :c:func:`apply_workqueue_attrs` select pools and thus
149149
* doesn't participate in pool hash calculations or equality comparisons.
150150
*/
151-
bool no_numa;
151+
bool ordered;
152152
};
153153

154154
static inline struct delayed_work *to_delayed_work(struct work_struct *work)

kernel/workqueue.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3672,10 +3672,10 @@ static void copy_workqueue_attrs(struct workqueue_attrs *to,
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)
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,
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,
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,
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)
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

0 commit comments

Comments
 (0)