[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0hyBg3mVhfERkTLUnARLrsGarvtKOnL=RrL9VGF5DNLsg@mail.gmail.com>
Date: Thu, 3 Jul 2025 16:40:15 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Zihuan Zhang <zhangzihuan@...inos.cn>
Cc: rafael@...nel.org, pavel@...nel.org, len.brown@...el.com,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/4] PM: freezer: Print tasks stuck in D-state during freeze
On Thu, Jun 19, 2025 at 5:54 AM Zihuan Zhang <zhangzihuan@...inos.cn> wrote:
>
> To help diagnose freezing delays caused by tasks stuck in D-state, this
> patch adds logging for tasks that are stuck in D-state during each retry
> of the freezer loop. Such tasks are not killable and cannot be frozen,
> which can cause the system suspend process to retry many times
> before aborting. This message can help developers identify which
> user-space or kernel tasks are blocking the freeze process.
>
> Signed-off-by: Zihuan Zhang <zhangzihuan@...inos.cn>
> ---
> kernel/power/process.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index 87616ca710ac..4007f621c2ad 100644
> --- a/kernel/power/process.c
> +++ b/kernel/power/process.c
> @@ -55,6 +55,9 @@ static int try_to_freeze_tasks(bool user_only)
> if (p == current || !freeze_task(p))
> continue;
>
> + if (retry > 1 && READ_ONCE(p->__state) == TASK_UNINTERRUPTIBLE)
> + sched_show_task(p);
> +
This is going to be too noisy IMV. Any chance to rate limit it somehow?
> todo++;
> }
> read_unlock(&tasklist_lock);
> --
> 2.25.1
>
Powered by blists - more mailing lists