From 729d6a55cb8fa90fe5bc37b24ffda2afc2b0eb6c Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: May 10 2023 14:34:46 +0000 Subject: workqueue: Warn when a rescuer could not be created (bsc#1211044). --- diff --git a/patches.suse/workqueue-Warn-when-a-rescuer-could-not-be-created.patch b/patches.suse/workqueue-Warn-when-a-rescuer-could-not-be-created.patch new file mode 100644 index 0000000..86e7e53 --- /dev/null +++ b/patches.suse/workqueue-Warn-when-a-rescuer-could-not-be-created.patch @@ -0,0 +1,48 @@ +From 4c0736a76a186e5df2cd2afda3e7a04d2a427d1b Mon Sep 17 00:00:00 2001 +From: Petr Mladek +Date: Tue, 7 Mar 2023 13:53:34 +0100 +Subject: [PATCH] workqueue: Warn when a rescuer could not be created +Git-commit: 4c0736a76a186e5df2cd2afda3e7a04d2a427d1b +Patch-mainline: v6.4-rc1 +References: bsc#1211044 + +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 +Signed-off-by: Tejun Heo + +--- + kernel/workqueue.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -4074,13 +4074,18 @@ struct workqueue_struct *__alloc_workque + struct worker *rescuer; + + rescuer = alloc_worker(NUMA_NO_NODE); +- if (!rescuer) ++ if (!rescuer) { ++ pr_err("workqueue: Failed to allocate a rescuer for wq \"%s\"\n", ++ wq->name); + goto err_destroy; ++ } + + rescuer->rescue_wq = wq; + rescuer->task = kthread_create(rescuer_thread, rescuer, "%s", + wq->name); + if (IS_ERR(rescuer->task)) { ++ pr_err("workqueue: Failed to create a rescuer kthread for wq \"%s\": %ld", ++ wq->name, PTR_ERR(rescuer->task)); + kfree(rescuer); + goto err_destroy; + } diff --git a/series.conf b/series.conf index fa2a90b..946ca81 100644 --- a/series.conf +++ b/series.conf @@ -63308,6 +63308,7 @@ patches.suse/workqueue-Fix-hung-time-report-of-worker-pools.patch patches.suse/workqueue-Warn-when-a-new-worker-could-not-be-create.patch patches.suse/workqueue-Interrupted-create_worker-is-not-a-repeate.patch + patches.suse/workqueue-Warn-when-a-rescuer-could-not-be-created.patch patches.suse/xfs-verify-buffer-contents-when-we-skip-log-replay.patch # dhowells/linux-fs keys-uefi