aboutsummaryrefslogtreecommitdiff
path: root/core/timer.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-05-22 15:53:02 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-06 20:49:06 +1000
commit05b8834b5a4ff9bd14548594700d354bc4486c5c (patch)
treebd6c90151fada7ab78a0dc1be3ffcbe319ca94d9 /core/timer.c
parentdb9c1422002c1333fd09177d32edb8c2003fb4ea (diff)
downloadskiboot-05b8834b5a4ff9bd14548594700d354bc4486c5c.zip
skiboot-05b8834b5a4ff9bd14548594700d354bc4486c5c.tar.gz
skiboot-05b8834b5a4ff9bd14548594700d354bc4486c5c.tar.bz2
Convert important polling loops to spin at lowest SMT priority
The pattern of calling cpu_relax() inside a polling loop does not suit the powerpc SMT priority instructions. Prefrred is to set a low priority then spin until break condition is reached, then restore priority. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart@linux.vnet.ibm.com: fixup lpc-uart wait_tx_room() and unit test] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/timer.c')
-rw-r--r--core/timer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/timer.c b/core/timer.c
index 7548996..4b5925f 100644
--- a/core/timer.c
+++ b/core/timer.c
@@ -45,7 +45,10 @@ static void __sync_timer(struct timer *t)
while (t->running) {
unlock(&timer_lock);
- cpu_relax();
+ smt_lowest();
+ while (t->running)
+ barrier();
+ smt_medium();
/* Should we call the pollers here ? */
lock(&timer_lock);
}