From 19f4343ba019729a3f86d27793bd9d83f0c1eab5 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: May 10 2023 14:34:45 +0000 Subject: workqueue: Interrupted create_worker() is not a repeated event (bsc#1211044). --- diff --git a/patches.suse/workqueue-Interrupted-create_worker-is-not-a-repeate.patch b/patches.suse/workqueue-Interrupted-create_worker-is-not-a-repeate.patch new file mode 100644 index 0000000..074efe2 --- /dev/null +++ b/patches.suse/workqueue-Interrupted-create_worker-is-not-a-repeate.patch @@ -0,0 +1,48 @@ +From 60f540389a5d2df25ddc7ad511b4fa2880dea521 Mon Sep 17 00:00:00 2001 +From: Petr Mladek +Date: Tue, 7 Mar 2023 13:53:33 +0100 +Subject: [PATCH] workqueue: Interrupted create_worker() is not a repeated + event +Git-commit: 60f540389a5d2df25ddc7ad511b4fa2880dea521 +Patch-mainline: v6.4-rc1 +References: bsc#1211044 + +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 +Signed-off-by: Tejun Heo + +--- + kernel/workqueue.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/kernel/workqueue.c b/kernel/workqueue.c +index 9760f0fca82d..5f0ecaaaf997 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: %ld", +- PTR_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: %ld", ++ PTR_ERR(worker->task)); ++ } + goto fail; + } + +-- +2.35.3 + diff --git a/series.conf b/series.conf index afef7b8..fa2a90b 100644 --- a/series.conf +++ b/series.conf @@ -63307,6 +63307,7 @@ patches.suse/usb-chipidea-fix-missing-goto-in-ci_hdrc_probe.patch 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/xfs-verify-buffer-contents-when-we-skip-log-replay.patch # dhowells/linux-fs keys-uefi