Commit 60f54038 authored by Petr Mladek's avatar Petr Mladek Committed by Tejun Heo
Browse files

workqueue: Interrupted create_worker() is not a repeated event



kthread_create_on_node() might get interrupted(). It is rare but realistic.
For example, when an unbound workqueue is allocated in module_init()
callback. It is done in the context of the "modprobe" process. And,
for example, systemd might kill pending processes when switching root
from initrd to the booted system.

The interrupt is a one-off event and the race might be hard to reproduce.
It is always worth printing.

Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 3f0ea0b8
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1959,8 +1959,13 @@ static struct worker *create_worker(struct worker_pool *pool)
	worker->task = kthread_create_on_node(worker_thread, worker, pool->node,
					      "kworker/%s", id_buf);
	if (IS_ERR(worker->task)) {
		if (PTR_ERR(worker->task) == -EINTR) {
			pr_err("workqueue: Interrupted when creating a worker thread \"kworker/%s\"\n",
			       id_buf);
		} else {
			pr_err_once("workqueue: Failed to create a worker thread: %pe",
				    worker->task);
		}
		goto fail;
	}