lkml.org 
[lkml]   [2013]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 18/29] locking, tsx: Abort is mutex_is_locked()
Date
From: Andi Kleen <ak@linux.intel.com>

Inside a elided mutex we cannot tell if the mutex is really locked
or not. Aborting it he safe answer.

Callers who frequently abort (e.g. BUG_ONs) need to be fixed
separately.

Noop without RTM.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
include/linux/mutex.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 9121595..0574095 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -14,6 +14,7 @@
#include <linux/spinlock_types.h>
#include <linux/linkage.h>
#include <linux/lockdep.h>
+#include <linux/elide.h>

#include <linux/atomic.h>

@@ -123,6 +124,7 @@ extern void __mutex_init(struct mutex *lock, const char *name,
*/
static inline int mutex_is_locked(struct mutex *lock)
{
+ elide_abort();
return atomic_read(&lock->count) != 1;
}

--
1.7.7.6


\
 
 \ /
  Last update: 2013-03-23 02:41    [W:0.180 / U:1.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site