[Skiboot] [PATCH 28/34] cpu: Remove pollers calling heuristics from cpu_wait_job

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Jul 24 09:27:22 AEST 2016


This will be handled by time_wait_ms(). Also remove a useless
smt_medium().

Note that this introduce a difference in behaviour: time_wait
will only call the pollers on the boot CPU while cpu_wait_job()
could call them on any. However, I can't think of a case where
this is a problem.

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

diff --git a/core/cpu.c b/core/cpu.c
index 8bad5b0..3f2ebd9 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -207,22 +207,18 @@ bool cpu_poll_job(struct cpu_job *job)
 
 void cpu_wait_job(struct cpu_job *job, bool free_it)
 {
-	unsigned long ticks = usecs_to_tb(5);
-	unsigned long period = msecs_to_tb(5);
 	unsigned long time_waited = 0;
 
 	if (!job)
 		return;
 
-	while(!job->complete) {
-		time_wait(ticks);
-		time_waited+=ticks;
-		if (time_waited % period == 0)
-			opal_run_pollers();
+	while (!job->complete) {
+		/* This will call OPAL pollers for us */
+		time_wait_ms(10);
+		time_waited += 10;
 		lwsync();
 	}
 	lwsync();
-	smt_medium();
 
 	if (time_waited > msecs_to_tb(1000))
 		prlog(PR_DEBUG, "cpu_wait_job(%s) for %lu\n",
-- 
2.7.4



More information about the Skiboot mailing list