[Skiboot] [PATCH 5/5] cpu: Better output when waiting for a very long job

Benjamin Herrenschmidt benh at kernel.crashing.org
Wed Aug 15 15:10:39 AEST 2018


Instead of printing at the end if the job took more than 1s,
print in the loop every 5s along with a backtrace. This will
give us some output if the job is deadlocked.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 core/cpu.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/core/cpu.c b/core/cpu.c
index a4c4d4ff..7ae2ba11 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -300,13 +300,14 @@ void cpu_wait_job(struct cpu_job *job, bool free_it)
 		time_wait_ms(10);
 		time_waited += 10;
 		lwsync();
+		if ((time_waited % 5000) == 0) {
+			prlog(PR_INFO, "cpu_wait_job(%s) for %lums\n",
+			      job->name, time_waited);
+			backtrace();
+		}
 	}
 	lwsync();
 
-	if (time_waited > 1000)
-		prlog(PR_DEBUG, "cpu_wait_job(%s) for %lums\n",
-		      job->name, time_waited);
-
 	if (free_it)
 		free(job);
 }
-- 
2.17.1



More information about the Skiboot mailing list