* [PATCH] kernel/hung_task.c: add error info when failed to start khungtaskd
@ 2021-10-22 8:47 Weitao Hou
2021-10-22 10:12 ` Tetsuo Handa
0 siblings, 1 reply; 2+ messages in thread
From: Weitao Hou @ 2021-10-22 8:47 UTC (permalink / raw)
To: akpm, lukas.bulwahn, sfr, linux, peterz, penguin-kernel,
andriy.shevchenko
Cc: linux-kernel, Weitao Hou
we need add necessary error info when core thread started failed
Signed-off-by: Weitao Hou <houweitao@didiglobal.com>
---
kernel/hung_task.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/hung_task.c b/kernel/hung_task.c
index 8cc07e7f29aa..8a95997a693e 100644
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -354,6 +354,10 @@ static int __init hung_task_init(void)
pm_notifier(hungtask_pm_notify, 0);
watchdog_task = kthread_run(watchdog, NULL, "khungtaskd");
+ if (IS_ERR(watchdog_task)) {
+ pr_err("Failed to start khungtaskd\n");
+ watchdog_task = NULL;
+ }
return 0;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kernel/hung_task.c: add error info when failed to start khungtaskd
2021-10-22 8:47 [PATCH] kernel/hung_task.c: add error info when failed to start khungtaskd Weitao Hou
@ 2021-10-22 10:12 ` Tetsuo Handa
0 siblings, 0 replies; 2+ messages in thread
From: Tetsuo Handa @ 2021-10-22 10:12 UTC (permalink / raw)
To: Weitao Hou
Cc: linux-kernel, akpm, lukas.bulwahn, sfr, linux, peterz, andriy.shevchenko
Hello.
On 2021/10/22 17:47, Weitao Hou wrote:
> we need add necessary error info when core thread started failed
This message is little useful. If kthread_run() from built-in modules' __init
functions is failing (due to e.g. out of memory), the system is already unusable.
>
> Signed-off-by: Weitao Hou <houweitao@didiglobal.com>
> ---
> kernel/hung_task.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/hung_task.c b/kernel/hung_task.c
> index 8cc07e7f29aa..8a95997a693e 100644
> --- a/kernel/hung_task.c
> +++ b/kernel/hung_task.c
> @@ -354,6 +354,10 @@ static int __init hung_task_init(void)
> pm_notifier(hungtask_pm_notify, 0);
>
> watchdog_task = kthread_run(watchdog, NULL, "khungtaskd");
> + if (IS_ERR(watchdog_task)) {
> + pr_err("Failed to start khungtaskd\n");
> + watchdog_task = NULL;
> + }
>
> return 0;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-22 10:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 8:47 [PATCH] kernel/hung_task.c: add error info when failed to start khungtaskd Weitao Hou
2021-10-22 10:12 ` Tetsuo Handa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).