[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1364001923-10796-19-git-send-email-andi@firstfloor.org>
Date: Fri, 22 Mar 2013 18:25:12 -0700
From: Andi Kleen <andi@...stfloor.org>
To: linux-kernel@...r.kernel.org
Cc: torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
x86@...nel.org, Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 18/29] locking, tsx: Abort is mutex_is_locked()
From: Andi Kleen <ak@...ux.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@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists