lockmgr: fix lock profiling of face adaptive spinning
This commit is contained in:
parent
a2cb65b8fe
commit
f902e4bb04
@ -631,6 +631,9 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk,
|
|||||||
if (lockmgr_slock_try(lk, &x, flags, false))
|
if (lockmgr_slock_try(lk, &x, flags, false))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
lock_profile_obtain_lock_failed(&lk->lock_object, false,
|
||||||
|
&contested, &waittime);
|
||||||
|
|
||||||
if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) {
|
if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) {
|
||||||
if (lockmgr_slock_adaptive(&lda, lk, &x, flags))
|
if (lockmgr_slock_adaptive(&lda, lk, &x, flags))
|
||||||
continue;
|
continue;
|
||||||
@ -639,8 +642,6 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk,
|
|||||||
#ifdef HWPMC_HOOKS
|
#ifdef HWPMC_HOOKS
|
||||||
PMC_SOFT_CALL( , , lock, failed);
|
PMC_SOFT_CALL( , , lock, failed);
|
||||||
#endif
|
#endif
|
||||||
lock_profile_obtain_lock_failed(&lk->lock_object, false,
|
|
||||||
&contested, &waittime);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the lock is expected to not sleep just give up
|
* If the lock is expected to not sleep just give up
|
||||||
@ -845,6 +846,10 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk,
|
|||||||
break;
|
break;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lock_profile_obtain_lock_failed(&lk->lock_object, false,
|
||||||
|
&contested, &waittime);
|
||||||
|
|
||||||
if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) {
|
if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) {
|
||||||
if (lockmgr_xlock_adaptive(&lda, lk, &x))
|
if (lockmgr_xlock_adaptive(&lda, lk, &x))
|
||||||
continue;
|
continue;
|
||||||
@ -852,8 +857,6 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk,
|
|||||||
#ifdef HWPMC_HOOKS
|
#ifdef HWPMC_HOOKS
|
||||||
PMC_SOFT_CALL( , , lock, failed);
|
PMC_SOFT_CALL( , , lock, failed);
|
||||||
#endif
|
#endif
|
||||||
lock_profile_obtain_lock_failed(&lk->lock_object, false,
|
|
||||||
&contested, &waittime);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the lock is expected to not sleep just give up
|
* If the lock is expected to not sleep just give up
|
||||||
|
Loading…
Reference in New Issue
Block a user