[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250619035355.33402-3-zhangzihuan@kylinos.cn>
Date: Thu, 19 Jun 2025 11:53:53 +0800
From: Zihuan Zhang <zhangzihuan@...inos.cn>
To: rafael@...nel.org,
pavel@...nel.org,
len.brown@...el.com
Cc: linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Zihuan Zhang <zhangzihuan@...inos.cn>
Subject: [PATCH v2 2/4] PM: freezer: Print tasks stuck in D-state during freeze
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);
+
todo++;
}
read_unlock(&tasklist_lock);
--
2.25.1
Powered by blists - more mailing lists