aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-04-01 14:23:32 -0400
committerTejun Heo <tj@kernel.org>2013-04-01 14:23:32 -0400
commite3c916a4c7f51722785d34d9f9802b70dac3ce93 (patch)
tree3891075836ae488fa5eb695d5a5dbbdd14eec0fa /kernel/workqueue.c
parentbce903809ab3f29eca97e0be5537778c1689c82b (diff)
workqueue: drop 'H' from kworker names of unbound worker pools
Currently, all workqueue workers which have negative nice value has 'H' postfixed to their names. This is necessary for per-cpu workers as they use the CPU number instead of pool->id to identify the pool and the 'H' postfix is the only thing distinguishing normal and highpri workers. As workers for unbound pools use pool->id, the 'H' postfix is purely informational. TASK_COMM_LEN is 16 and after the static part and delimiters, there are only five characters left for the pool and worker IDs. We're expecting to have more unbound pools with the scheduled NUMA awareness support. Let's drop the non-essential 'H' postfix from unbound kworker name. While at it, restructure kthread_create*() invocation to help future NUMA related changes. Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 5ca46a2e2616..248d18aa2a5d 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1644,9 +1644,10 @@ static struct worker *alloc_worker(void)
1644 */ 1644 */
1645static struct worker *create_worker(struct worker_pool *pool) 1645static struct worker *create_worker(struct worker_pool *pool)
1646{ 1646{
1647 const char *pri = pool->attrs->nice < 0 ? "H" : "";
1648 struct worker *worker = NULL; 1647 struct worker *worker = NULL;
1648 int node = pool->cpu >= 0 ? cpu_to_node(pool->cpu) : NUMA_NO_NODE;
1649 int id = -1; 1649 int id = -1;
1650 char id_buf[16];
1650 1651
1651 lockdep_assert_held(&pool->manager_mutex); 1652 lockdep_assert_held(&pool->manager_mutex);
1652 1653
@@ -1672,13 +1673,13 @@ static struct worker *create_worker(struct worker_pool *pool)
1672 worker->id = id; 1673 worker->id = id;
1673 1674
1674 if (pool->cpu >= 0) 1675 if (pool->cpu >= 0)
1675 worker->task = kthread_create_on_node(worker_thread, 1676 snprintf(id_buf, sizeof(id_buf), "%d:%d%s", pool->cpu, id,
1676 worker, cpu_to_node(pool->cpu), 1677 pool->attrs->nice < 0 ? "H" : "");
1677 "kworker/%d:%d%s", pool->cpu, id, pri);
1678 else 1678 else
1679 worker->task = kthread_create(worker_thread, worker, 1679 snprintf(id_buf, sizeof(id_buf), "u%d:%d", pool->id, id);
1680 "kworker/u%d:%d%s", 1680
1681 pool->id, id, pri); 1681 worker->task = kthread_create_on_node(worker_thread, worker, node,
1682 "kworker/%s", id_buf);
1682 if (IS_ERR(worker->task)) 1683 if (IS_ERR(worker->task))
1683 goto fail; 1684 goto fail;
1684 1685