diff options
author | Mark Johnston <markj@FreeBSD.org> | 2017-11-24 19:02:06 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2017-11-24 19:02:06 +0000 |
commit | 26d94f99af38d69a5d0aeae96eaf96cf36813db1 (patch) | |
tree | a0a429349e2c2944243f8fad7aea2f035693ebe7 /sys/kern/kern_sx.c | |
parent | f8e61edaa12e9a0510b14bf17acbda2dc7a04bb5 (diff) |
Notes
Diffstat (limited to 'sys/kern/kern_sx.c')
-rw-r--r-- | sys/kern/kern_sx.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 9bcc4021b63b..e9f8459cf373 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -480,10 +480,8 @@ sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) x = sx->sx_lock; if (!(x & SX_LOCK_SHARED_WAITERS) && atomic_cmpset_rel_ptr(&sx->sx_lock, x, SX_SHARERS_LOCK(1) | - (x & SX_LOCK_EXCLUSIVE_WAITERS))) { - LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); - return; - } + (x & SX_LOCK_EXCLUSIVE_WAITERS))) + goto out; /* * Lock the sleep queue so we can read the waiters bits @@ -504,11 +502,12 @@ sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) 0, SQ_SHARED_QUEUE); sleepq_release(&sx->lock_object); - LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); - LOCKSTAT_RECORD0(sx__downgrade, sx); - if (wakeup_swapper) kick_proc0(); + +out: + LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); + LOCKSTAT_RECORD0(sx__downgrade, sx); } void |