summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-04-21 04:34:13 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-04-21 04:34:13 +0000
commite98d69b14dd08856abde29fb967f9eb1c845bb3a (patch)
tree944b112e2faa13021c7af6cb8e644090316911cf /sys/arch/hppa64
parentf2eeae2112eae0b48bcd954af6ff7d73a0e39ab1 (diff)
Revert the ``remove the `skip splraise/splx for IPL_NONE mutexes' optimization''
change. It seems to have unexpected side effects, especially on MP systems, and drahn@ disagrees with the way this change has been done and think there is a better way to solve the original problem of msleep() fiddling with mutex internals.
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r--sys/arch/hppa64/hppa64/mutex.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/hppa64/hppa64/mutex.c b/sys/arch/hppa64/hppa64/mutex.c
index 7a1efbe5060..c51aa9a31c7 100644
--- a/sys/arch/hppa64/hppa64/mutex.c
+++ b/sys/arch/hppa64/hppa64/mutex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mutex.c,v 1.6 2011/04/03 18:46:40 miod Exp $ */
+/* $OpenBSD: mutex.c,v 1.7 2011/04/21 04:34:12 miod Exp $ */
/*
* Copyright (c) 2004 Artur Grabowski <art@openbsd.org>
@@ -48,7 +48,8 @@ mtx_init(struct mutex *mtx, int wantipl)
void
mtx_enter(struct mutex *mtx)
{
- mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
+ if (mtx->mtx_wantipl != IPL_NONE)
+ mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
MUTEX_ASSERT_UNLOCKED(mtx);
mtx->mtx_lock = 1;
#ifdef DIAGNOSTIC
@@ -59,7 +60,8 @@ mtx_enter(struct mutex *mtx)
int
mtx_enter_try(struct mutex *mtx)
{
- mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
+ if (mtx->mtx_wantipl != IPL_NONE)
+ mtx->mtx_oldipl = splraise(mtx->mtx_wantipl);
MUTEX_ASSERT_UNLOCKED(mtx);
mtx->mtx_lock = 1;
#ifdef DIAGNOSTIC
@@ -77,5 +79,6 @@ mtx_leave(struct mutex *mtx)
curcpu()->ci_mutex_level--;
#endif
mtx->mtx_lock = 0;
- splx(mtx->mtx_oldipl);
+ if (mtx->mtx_wantipl != IPL_NONE)
+ splx(mtx->mtx_oldipl);
}