diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2017-02-17 05:39:40 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2017-02-17 05:39:40 +0000 |
commit | ffd5c94c4fc333e76f19571a02c6c704177c596d (patch) | |
tree | f9ae906cef81d0de13ae7855e51d8fb09858159e /sys/kern/kern_rwlock.c | |
parent | 7a465c285fb94b892496ed14ac331f45944f420c (diff) | |
download | src-ffd5c94c4fc333e76f19571a02c6c704177c596d.tar.gz src-ffd5c94c4fc333e76f19571a02c6c704177c596d.zip |
locks: let primitives for modules unlock without always goging to the slsow path
It is only needed if the LOCK_PROFILING is enabled. It has to always check if
the lock is about to be released which requires an avoidable read if the option
is not specified..
Notes
Notes:
svn path=/head/; revision=313855
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r-- | sys/kern/kern_rwlock.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index fcb7d00c3d68..bf74b6710499 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -341,7 +341,11 @@ _rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line) LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line); +#ifdef LOCK_PROFILING _rw_wunlock_hard(rw, (uintptr_t)curthread, file, line); +#else + __rw_wunlock(rw, curthread, file, line); +#endif TD_LOCKS_DEC(curthread); } |