diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-03 18:46:42 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-03 18:46:42 +0000 |
commit | a6353483b94ab2a137a9b22b497213fb3e42d30f (patch) | |
tree | 7f03af461756562fa42aa96c4f5185b07ccb089d /sys/arch/sparc | |
parent | 42cad736a05d3379f03bc81bc9d230c7b04b4d7a (diff) |
Remove the `skip splraise/splx for IPL_NONE mutexes' optimizations. It is not
always gaining anything, and msleep() implementation depends upon mtx_leave()
invoking splx().
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/sparc/mutex.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/arch/sparc/sparc/mutex.c b/sys/arch/sparc/sparc/mutex.c index 4ed1528a275..03b532d018a 100644 --- a/sys/arch/sparc/sparc/mutex.c +++ b/sys/arch/sparc/sparc/mutex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.c,v 1.5 2010/09/28 20:27:55 miod Exp $ */ +/* $OpenBSD: mutex.c,v 1.6 2011/04/03 18:46:40 miod Exp $ */ /* * Copyright (c) 2004 Artur Grabowski <art@openbsd.org> @@ -52,12 +52,10 @@ mtx_enter(struct mutex *mtx) { int psr; - if (mtx->mtx_wantipl != IPL_NONE << 8) { - psr = getpsr(); - mtx->mtx_oldipl = psr & PSR_PIL; - if (mtx->mtx_oldipl < mtx->mtx_wantipl) - setpsr((psr & ~PSR_PIL) | mtx->mtx_wantipl); - } + psr = getpsr(); + mtx->mtx_oldipl = psr & PSR_PIL; + if (mtx->mtx_oldipl < mtx->mtx_wantipl) + setpsr((psr & ~PSR_PIL) | mtx->mtx_wantipl); MUTEX_ASSERT_UNLOCKED(mtx); mtx->mtx_lock = 1; @@ -71,12 +69,10 @@ mtx_enter_try(struct mutex *mtx) { int psr; - if (mtx->mtx_wantipl != IPL_NONE << 8) { - psr = getpsr(); - mtx->mtx_oldipl = psr & PSR_PIL; - if (mtx->mtx_oldipl < mtx->mtx_wantipl) - setpsr((psr & ~PSR_PIL) | mtx->mtx_wantipl); - } + psr = getpsr(); + mtx->mtx_oldipl = psr & PSR_PIL; + if (mtx->mtx_oldipl < mtx->mtx_wantipl) + setpsr((psr & ~PSR_PIL) | mtx->mtx_wantipl); MUTEX_ASSERT_UNLOCKED(mtx); mtx->mtx_lock = 1; @@ -95,6 +91,5 @@ mtx_leave(struct mutex *mtx) curcpu()->ci_mutex_level--; #endif mtx->mtx_lock = 0; - if (mtx->mtx_wantipl != IPL_NONE << 8) - splx(mtx->mtx_oldipl); + splx(mtx->mtx_oldipl); } |