History

workqueue: Remove module param disable_numa and sysfs knobs pool_ids and numa

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.

Tejun Heo committed 3 years ago

Commit fcecfa81 parent 797e8342 files · +0 −82Browse files

Unified · Split

2 files
  1. Documentation/admin-guide/kernel-parameters.txt +0 −9
  2. kernel/workqueue.c +0 −73
Documentation/admin-guide/kernel-parameters.txt+0−9
@@ -6992,15 +6992,6 @@ · 6991 unmodified lines
6992 threshold repeatedly. They are likely good6992 threshold repeatedly. They are likely good
6993 candidates for using WQ_UNBOUND workqueues instead.6993 candidates for using WQ_UNBOUND workqueues instead.
6994 6994
6995 workqueue.disable_numa
6996 By default, all work items queued to unbound
6997 workqueues are affine to the NUMA nodes they're
6998 issued on, which results in better behavior in
6999 general. If NUMA affinity needs to be disabled for
7000 whatever reason, this option can be used. Note
7001 that this also can be controlled per-workqueue for
7002 workqueues visible under /sys/bus/workqueue/.
7003
7004 workqueue.power_efficient6995 workqueue.power_efficient
7005 Per-cpu workqueues are generally preferred because6996 Per-cpu workqueues are generally preferred because
7006 they show better performance thanks to cache6997 they show better performance thanks to cache
kernel/workqueue.c+0−73
@@ -340,9 +340,6 @@ static cpumask_var_t *wq_numa_possible_cpumask; · 339 unmodified lines
340static unsigned long wq_cpu_intensive_thresh_us = ULONG_MAX;340static unsigned long wq_cpu_intensive_thresh_us = ULONG_MAX;
341module_param_named(cpu_intensive_thresh_us, wq_cpu_intensive_thresh_us, ulong, 0644);341module_param_named(cpu_intensive_thresh_us, wq_cpu_intensive_thresh_us, ulong, 0644);
342 342
343static bool wq_disable_numa;
344module_param_named(disable_numa, wq_disable_numa, bool, 0444);
345
346/* see the comment above the definition of WQ_POWER_EFFICIENT */343/* see the comment above the definition of WQ_POWER_EFFICIENT */
347static bool wq_power_efficient = IS_ENABLED(CONFIG_WQ_POWER_EFFICIENT_DEFAULT);344static bool wq_power_efficient = IS_ENABLED(CONFIG_WQ_POWER_EFFICIENT_DEFAULT);
348module_param_named(power_efficient, wq_power_efficient, bool, 0444);345module_param_named(power_efficient, wq_power_efficient, bool, 0444);
@@ -5794,10 +5791,8 @@ out_unlock: · 5445 unmodified lines
5794 *5791 *
5795 * Unbound workqueues have the following extra attributes.5792 * Unbound workqueues have the following extra attributes.
5796 *5793 *
5797 * pool_ids RO int : the associated pool IDs for each node
5798 * nice RW int : nice value of the workers5794 * nice RW int : nice value of the workers
5799 * cpumask RW mask : bitmask of allowed CPUs for the workers5795 * cpumask RW mask : bitmask of allowed CPUs for the workers
5800 * numa RW bool : whether enable NUMA affinity
5801 */5796 */
5802struct wq_device {5797struct wq_device {
5803 struct workqueue_struct *wq;5798 struct workqueue_struct *wq;
@@ -5850,28 +5845,6 @@ static struct attribute *wq_sysfs_attrs[] = { · 46 unmodified lines
5850};5845};
5851ATTRIBUTE_GROUPS(wq_sysfs);5846ATTRIBUTE_GROUPS(wq_sysfs);
5852 5847
5853static 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
5875static ssize_t wq_nice_show(struct device *dev, struct device_attribute *attr,5848static ssize_t wq_nice_show(struct device *dev, struct device_attribute *attr,
5876 char *buf)5849 char *buf)
5877{5850{
@@ -5962,50 +5935,9 @@ out_unlock: · 84 unmodified lines
5962 return ret ?: count;5935 return ret ?: count;
5963}5936}
5964 5937
5965static 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
5979static 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
5998out_unlock:
5999 apply_wqattrs_unlock();
6000 free_workqueue_attrs(attrs);
6001 return ret ?: count;
6002}
6003
6004static struct device_attribute wq_sysfs_unbound_attrs[] = {5938static struct device_attribute wq_sysfs_unbound_attrs[] = {
6005 __ATTR(pool_ids, 0444, wq_pool_ids_show, NULL),
6006 __ATTR(nice, 0644, wq_nice_show, wq_nice_store),5939 __ATTR(nice, 0644, wq_nice_show, wq_nice_store),
6007 __ATTR(cpumask, 0644, wq_cpumask_show, wq_cpumask_store),5940 __ATTR(cpumask, 0644, wq_cpumask_show, wq_cpumask_store),
6008 __ATTR(numa, 0644, wq_numa_show, wq_numa_store),
6009 __ATTR_NULL,5941 __ATTR_NULL,
6010};5942};
6011 5943
@@ -6379,11 +6311,6 @@ static void __init wq_numa_init(void) · 367 unmodified lines
6379 if (num_possible_nodes() <= 1)6311 if (num_possible_nodes() <= 1)
6380 return;6312 return;
6381 6313
6382 if (wq_disable_numa) {
6383 pr_info("workqueue: NUMA affinity support disabled\n");
6384 return;
6385 }
6386
6387 for_each_possible_cpu(cpu) {6314 for_each_possible_cpu(cpu) {
6388 if (WARN_ON(cpu_to_node(cpu) == NUMA_NO_NODE)) {6315 if (WARN_ON(cpu_to_node(cpu) == NUMA_NO_NODE)) {
6389 pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu);6316 pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu);