Unbound workqueue CPU affinity is going to receive an overhaul and the NUMA specific knobs won't make sense anymore. Remove them. Also, the pool_ids knob was used for debugging and not really meaningful given that there is no visibility into the pools associated with those IDs. Remove it too. A future patch will improve overall visibility.
Showing the changes to kernel/workqueue.c (1 of 2 files). Show all
Unified · Split
| @@ -340,9 +340,6 @@ static cpumask_var_t *wq_numa_possible_cpumask; · 339 unmodified lines | ||
| 340 | 340 | static unsigned long wq_cpu_intensive_thresh_us = ULONG_MAX; |
| 341 | 341 | module_param_named(cpu_intensive_thresh_us, wq_cpu_intensive_thresh_us, ulong, 0644); |
| 342 | 342 | |
| 343 | −static bool wq_disable_numa; | |
| 344 | −module_param_named(disable_numa, wq_disable_numa, bool, 0444); | |
| 345 | − | |
| 346 | 343 | /* see the comment above the definition of WQ_POWER_EFFICIENT */ |
| 347 | 344 | static bool wq_power_efficient = IS_ENABLED(CONFIG_WQ_POWER_EFFICIENT_DEFAULT); |
| 348 | 345 | module_param_named(power_efficient, wq_power_efficient, bool, 0444); |
| @@ -5794,10 +5791,8 @@ out_unlock: · 5445 unmodified lines | ||
| 5794 | 5791 | * |
| 5795 | 5792 | * Unbound workqueues have the following extra attributes. |
| 5796 | 5793 | * |
| 5797 | − * pool_ids RO int : the associated pool IDs for each node | |
| 5798 | 5794 | * nice RW int : nice value of the workers |
| 5799 | 5795 | * cpumask RW mask : bitmask of allowed CPUs for the workers |
| 5800 | − * numa RW bool : whether enable NUMA affinity | |
| 5801 | 5796 | */ |
| 5802 | 5797 | struct wq_device { |
| 5803 | 5798 | struct workqueue_struct *wq; |
| @@ -5850,28 +5845,6 @@ static struct attribute *wq_sysfs_attrs[] = { · 46 unmodified lines | ||
| 5850 | 5845 | }; |
| 5851 | 5846 | ATTRIBUTE_GROUPS(wq_sysfs); |
| 5852 | 5847 | |
| 5853 | −static ssize_t wq_pool_ids_show(struct device *dev, | |
| 5854 | − struct device_attribute *attr, char *buf) | |
| 5855 | −{ | |
| 5856 | − struct workqueue_struct *wq = dev_to_wq(dev); | |
| 5857 | − const char *delim = ""; | |
| 5858 | − int node, written = 0; | |
| 5859 | − | |
| 5860 | − cpus_read_lock(); | |
| 5861 | − rcu_read_lock(); | |
| 5862 | − for_each_node(node) { | |
| 5863 | − written += scnprintf(buf + written, PAGE_SIZE - written, | |
| 5864 | − "%s%d:%d", delim, node, | |
| 5865 | − unbound_pwq_by_node(wq, node)->pool->id); | |
| 5866 | − delim = " "; | |
| 5867 | − } | |
| 5868 | − written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); | |
| 5869 | − rcu_read_unlock(); | |
| 5870 | − cpus_read_unlock(); | |
| 5871 | − | |
| 5872 | − return written; | |
| 5873 | −} | |
| 5874 | − | |
| 5875 | 5848 | static ssize_t wq_nice_show(struct device *dev, struct device_attribute *attr, |
| 5876 | 5849 | char *buf) |
| 5877 | 5850 | { |
| @@ -5962,50 +5935,9 @@ out_unlock: · 84 unmodified lines | ||
| 5962 | 5935 | return ret ?: count; |
| 5963 | 5936 | } |
| 5964 | 5937 | |
| 5965 | −static ssize_t wq_numa_show(struct device *dev, struct device_attribute *attr, | |
| 5966 | − char *buf) | |
| 5967 | −{ | |
| 5968 | − struct workqueue_struct *wq = dev_to_wq(dev); | |
| 5969 | − int written; | |
| 5970 | − | |
| 5971 | − mutex_lock(&wq->mutex); | |
| 5972 | − written = scnprintf(buf, PAGE_SIZE, "%d\n", | |
| 5973 | − !wq->unbound_attrs->no_numa); | |
| 5974 | − mutex_unlock(&wq->mutex); | |
| 5975 | − | |
| 5976 | − return written; | |
| 5977 | −} | |
| 5978 | − | |
| 5979 | −static ssize_t wq_numa_store(struct device *dev, struct device_attribute *attr, | |
| 5980 | − const char *buf, size_t count) | |
| 5981 | −{ | |
| 5982 | − struct workqueue_struct *wq = dev_to_wq(dev); | |
| 5983 | − struct workqueue_attrs *attrs; | |
| 5984 | − int v, ret = -ENOMEM; | |
| 5985 | − | |
| 5986 | − apply_wqattrs_lock(); | |
| 5987 | − | |
| 5988 | − attrs = wq_sysfs_prep_attrs(wq); | |
| 5989 | − if (!attrs) | |
| 5990 | − goto out_unlock; | |
| 5991 | − | |
| 5992 | − ret = -EINVAL; | |
| 5993 | − if (sscanf(buf, "%d", &v) == 1) { | |
| 5994 | − attrs->no_numa = !v; | |
| 5995 | − ret = apply_workqueue_attrs_locked(wq, attrs); | |
| 5996 | − } | |
| 5997 | − | |
| 5998 | −out_unlock: | |
| 5999 | − apply_wqattrs_unlock(); | |
| 6000 | − free_workqueue_attrs(attrs); | |
| 6001 | − return ret ?: count; | |
| 6002 | −} | |
| 6003 | − | |
| 6004 | 5938 | static struct device_attribute wq_sysfs_unbound_attrs[] = { |
| 6005 | − __ATTR(pool_ids, 0444, wq_pool_ids_show, NULL), | |
| 6006 | 5939 | __ATTR(nice, 0644, wq_nice_show, wq_nice_store), |
| 6007 | 5940 | __ATTR(cpumask, 0644, wq_cpumask_show, wq_cpumask_store), |
| 6008 | − __ATTR(numa, 0644, wq_numa_show, wq_numa_store), | |
| 6009 | 5941 | __ATTR_NULL, |
| 6010 | 5942 | }; |
| 6011 | 5943 | |
| @@ -6379,11 +6311,6 @@ static void __init wq_numa_init(void) · 367 unmodified lines | ||
| 6379 | 6311 | if (num_possible_nodes() <= 1) |
| 6380 | 6312 | return; |
| 6381 | 6313 | |
| 6382 | − if (wq_disable_numa) { | |
| 6383 | − pr_info("workqueue: NUMA affinity support disabled\n"); | |
| 6384 | − return; | |
| 6385 | − } | |
| 6386 | − | |
| 6387 | 6314 | for_each_possible_cpu(cpu) { |
| 6388 | 6315 | if (WARN_ON(cpu_to_node(cpu) == NUMA_NO_NODE)) { |
| 6389 | 6316 | pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu); |