aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mladek <[email protected]>2023-03-07 13:53:34 +0100
committerTejun Heo <[email protected]>2023-03-17 12:03:46 -1000
commit4c0736a76a186e5df2cd2afda3e7a04d2a427d1b (patch)
treeee9ee79f1bca32553a91018a05452421f98379ac
parent60f540389a5d2df25ddc7ad511b4fa2880dea521 (diff)
workqueue: Warn when a rescuer could not be created
Rescuers are created when a workqueue with WQ_MEM_RECLAIM is allocated. It typically happens during the system boot. systemd switches the root filesystem from initrd to the booted system during boot. It kills processes that block the switch for too long. One of the process might be modprobe that tries to create a workqueue. These problems are hard to reproduce. Also alloc_workqueue() does not pass the error code. Make the debugging easier by printing an error, similar to create_worker(). Signed-off-by: Petr Mladek <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
-rw-r--r--kernel/workqueue.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 5f0ecaaaf997..fb1eb7a3f49b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4391,13 +4391,18 @@ static int init_rescuer(struct workqueue_struct *wq)
return 0;
rescuer = alloc_worker(NUMA_NO_NODE);
- if (!rescuer)
+ if (!rescuer) {
+ pr_err("workqueue: Failed to allocate a rescuer for wq \"%s\"\n",
+ wq->name);
return -ENOMEM;
+ }
rescuer->rescue_wq = wq;
rescuer->task = kthread_create(rescuer_thread, rescuer, "%s", wq->name);
if (IS_ERR(rescuer->task)) {
ret = PTR_ERR(rescuer->task);
+ pr_err("workqueue: Failed to create a rescuer kthread for wq \"%s\": %pe",
+ wq->name, ERR_PTR(ret));
kfree(rescuer);
return ret;
}