aboutsummaryrefslogtreecommitdiff
path: root/include/lock.h
AgeCommit message (Collapse)AuthorFilesLines
2017-12-20lock: Add additional lock auditing codeBenjamin Herrenschmidt1-5/+28
Keep track of lock owner name and replace lock_depth counter with a per-cpu list of locks held by the cpu. This allows us to print the actual locks held in case we hit the (in)famous message about opal_pollers being run with a lock held. It also allows us to warn (and drop them) if locks are still held when returning to the OS or completing a scheduled job. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix unit tests] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-12-20lock: Move cmpxchg() primitives to their own fileBenjamin Herrenschmidt1-57/+1
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-12-03core/lock: Introduce atomic cmpxchg and implement try_lock with itNicholas Piggin1-2/+59
cmpxchg will be used in a subsequent change, and this reduces the amount of asm code. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix some ifdef __TEST__ foo to ensure unittests work] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-12Use LOCK_UNLOCKED macro to in init_lock()Michael Neuling1-2/+1
Avoids duplication of init values. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-07-08lock: Add helper to check if this CPU is already holding a lockBenjamin Herrenschmidt1-0/+2
For debug purposes essentially Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt1-0/+83
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>