aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2023-03-07 13:53:33 +0100
committerTejun Heo <tj@kernel.org>2023-03-17 12:03:46 -1000
commit60f540389a5d2df25ddc7ad511b4fa2880dea521 (patch)
treecafad6e277b1af7640aacbe135dd7108c011de5f /kernel/workqueue.c
parent3f0ea0b864562c6bd1cee892026067eaea7be242 (diff)
downloadlinux-60f540389a5d2df25ddc7ad511b4fa2880dea521.tar.gz
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: Petr Mladek <pmladek@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 9760f0fca82d0..5f0ecaaaf9977 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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)) {
- pr_err_once("workqueue: Failed to create a worker thread: %pe",
- 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;
}