[Skiboot] [PATCH 04/34] list: Use list_empty_nocheck() when checking a list racily

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Jul 24 09:26:58 AEST 2016


Otherwise we might trigger an assertion when list debug is enabled

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 core/cpu.c   | 3 ++-
 core/timer.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/cpu.c b/core/cpu.c
index f33ac48..b525573 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -177,7 +177,8 @@ void cpu_process_jobs(void)
 	void *data;
 
 	sync();
-	if (list_empty(&cpu->job_queue) && list_empty(&global_job_queue))
+	if (list_empty_nocheck(&cpu->job_queue) &&
+	    list_empty_nocheck(&global_job_queue))
 		return;
 
 	lock(&cpu->job_lock);
diff --git a/core/timer.c b/core/timer.c
index 210e2a0..7548996 100644
--- a/core/timer.c
+++ b/core/timer.c
@@ -230,7 +230,7 @@ void check_timers(bool from_interrupt)
 
 	/* Lockless "peek", a bit racy but shouldn't be a problem */
 	t = list_top(&timer_list, struct timer, link);
-	if (list_empty(&timer_poll_list) && (!t || t->target > now))
+	if (list_empty_nocheck(&timer_poll_list) && (!t || t->target > now))
 		return;
 
 	/* Take lock and try again */
-- 
2.7.4



More information about the Skiboot mailing list