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.
Showing the changes to kernel/workqueue.c (1 of 2 files). Show all
Unified · Split
| @@ -3672,10 +3672,10 @@ static void copy_workqueue_attrs(struct workqueue_attrs *to, · 3671 unmodified lines | |||
| 3672 | cpumask_copy(to->cpumask, from->cpumask); | 3672 | cpumask_copy(to->cpumask, from->cpumask); |
| 3673 | /* | 3673 | /* |
| 3674 | * Unlike hash and equality test, this function doesn't ignore | 3674 | * Unlike hash and equality test, this function doesn't ignore |
| 3675 | * ->no_numa as it is used for both pool and wq attrs. Instead, | 3675 | * ->ordered as it is used for both pool and wq attrs. Instead, |
| 3676 | * get_unbound_pool() explicitly clears ->no_numa after copying. | 3676 | * get_unbound_pool() explicitly clears ->ordered after copying. |
| 3677 | */ | 3677 | */ |
| 3678 | to->no_numa = from->no_numa; | 3678 | to->ordered = from->ordered; |
| 3679 | } | 3679 | } |
| 3680 | 3680 | ||
| 3681 | /* hash value of the content of @attr */ | 3681 | /* 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 | |||
| 3933 | pool->node = target_node; | 3933 | pool->node = target_node; |
| 3934 | 3934 | ||
| 3935 | /* | 3935 | /* |
| 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 |
| 3937 | * 'struct workqueue_attrs' comments for detail. | 3937 | * 'struct workqueue_attrs' comments for detail. |
| 3938 | */ | 3938 | */ |
| 3939 | pool->attrs->no_numa = false; | 3939 | pool->attrs->ordered = false; |
| 3940 | 3940 | ||
| 3941 | if (worker_pool_assign_id(pool) < 0) | 3941 | if (worker_pool_assign_id(pool) < 0) |
| 3942 | goto fail; | 3942 | goto fail; |
| @@ -4141,7 +4141,7 @@ static struct pool_workqueue *alloc_unbound_pwq(struct workqueue_struct *wq, · 198 unmodified lines | |||
| 4141 | static void wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node, | 4141 | static void wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node, |
| 4142 | int cpu_going_down, cpumask_t *cpumask) | 4142 | int cpu_going_down, cpumask_t *cpumask) |
| 4143 | { | 4143 | { |
| 4144 | if (!wq_numa_enabled || attrs->no_numa) | 4144 | if (!wq_numa_enabled || attrs->ordered) |
| 4145 | goto use_dfl; | 4145 | goto use_dfl; |
| 4146 | 4146 | ||
| 4147 | /* does @node have any online CPUs @attrs wants? */ | 4147 | /* does @node have any online CPUs @attrs wants? */ |
| @@ -4253,7 +4253,7 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, · 105 unmodified lines | |||
| 4253 | goto out_free; | 4253 | goto out_free; |
| 4254 | 4254 | ||
| 4255 | for_each_possible_cpu(cpu) { | 4255 | for_each_possible_cpu(cpu) { |
| 4256 | if (new_attrs->no_numa) { | 4256 | if (new_attrs->ordered) { |
| 4257 | ctx->dfl_pwq->refcnt++; | 4257 | ctx->dfl_pwq->refcnt++; |
| 4258 | ctx->pwq_tbl[cpu] = ctx->dfl_pwq; | 4258 | ctx->pwq_tbl[cpu] = ctx->dfl_pwq; |
| 4259 | } else { | 4259 | } else { |
| @@ -4411,7 +4411,7 @@ static void wq_update_unbound_numa(struct workqueue_struct *wq, int cpu, · 151 unmodified lines | |||
| 4411 | lockdep_assert_held(&wq_pool_mutex); | 4411 | lockdep_assert_held(&wq_pool_mutex); |
| 4412 | 4412 | ||
| 4413 | if (!wq_numa_enabled || !(wq->flags & WQ_UNBOUND) || | 4413 | if (!wq_numa_enabled || !(wq->flags & WQ_UNBOUND) || |
| 4414 | wq->unbound_attrs->no_numa) | 4414 | wq->unbound_attrs->ordered) |
| 4415 | return; | 4415 | return; |
| 4416 | 4416 | ||
| 4417 | /* | 4417 | /* |
| @@ -6358,11 +6358,10 @@ void __init workqueue_init_early(void) · 1940 unmodified lines | |||
| 6358 | /* | 6358 | /* |
| 6359 | * An ordered wq should have only one pwq as ordering is | 6359 | * An ordered wq should have only one pwq as ordering is |
| 6360 | * guaranteed by max_active which is enforced by pwqs. | 6360 | * guaranteed by max_active which is enforced by pwqs. |
| 6361 | * Turn off NUMA so that dfl_pwq is used for all nodes. | ||
| 6362 | */ | 6361 | */ |
| 6363 | BUG_ON(!(attrs = alloc_workqueue_attrs())); | 6362 | BUG_ON(!(attrs = alloc_workqueue_attrs())); |
| 6364 | attrs->nice = std_nice[i]; | 6363 | attrs->nice = std_nice[i]; |
| 6365 | attrs->no_numa = true; | 6364 | attrs->ordered = true; |
| 6366 | ordered_wq_attrs[i] = attrs; | 6365 | ordered_wq_attrs[i] = attrs; |
| 6367 | } | 6366 | } |
| 6368 | 6367 | ||