summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-11-29 15:36:57 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-03 22:10:55 -0600
commitbc74922ab1ed025bf8216b49fb7b214d74de087a (patch)
tree9004aaf6cba4ccde8494e304430142c582e62dee
parent1486a08de557b8f237a066a57cc2c74961ba36e0 (diff)
downloadblackbird-skiboot-bc74922ab1ed025bf8216b49fb7b214d74de087a.tar.gz
blackbird-skiboot-bc74922ab1ed025bf8216b49fb7b214d74de087a.zip
core/lock: improve bust_locks
Prevent try_lock from modifying the lock state when bust_locks is set. unlock will not unlock it in that case, so locks will get taken and never released while bust_locks is set. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/lock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/lock.c b/core/lock.c
index 916a0241..b5e3323f 100644
--- a/core/lock.c
+++ b/core/lock.c
@@ -93,6 +93,9 @@ bool try_lock(struct lock *l)
{
struct cpu_thread *cpu = this_cpu();
+ if (bust_locks)
+ return true;
+
if (__try_lock(cpu, l)) {
if (l->in_con_path)
cpu->con_suspend++;
OpenPOWER on IntegriCloud