From dbe4541db264f4096fd68f89ed74bf52bd6e9694 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 24 Nov 2017 19:04:31 +0000 Subject: [PATCH] Have lockstat:::sx-release fire only after the lock state has changed. MFC after: 1 week --- sys/kern/kern_sx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index e9f8459cf37..d5acd0ad89f 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -1180,8 +1180,6 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF) if (SCHEDULER_STOPPED()) return; - LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER); - for (;;) { if (_sx_sunlock_try(sx, &x)) break; @@ -1217,6 +1215,7 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF) kick_proc0(); break; } + LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER); } void