locks: pull up PMC_SOFT_CALLs out of slow path loops
This commit is contained in:
parent
3af300592c
commit
ae7d25a4d7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325919
@ -443,6 +443,12 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v,
|
|||||||
#endif
|
#endif
|
||||||
rw = rwlock2rw(c);
|
rw = rwlock2rw(c);
|
||||||
|
|
||||||
|
#ifdef HWPMC_HOOKS
|
||||||
|
PMC_SOFT_CALL( , , lock, failed);
|
||||||
|
#endif
|
||||||
|
lock_profile_obtain_lock_failed(&rw->lock_object,
|
||||||
|
&contested, &waittime);
|
||||||
|
|
||||||
#ifdef LOCK_PROFILING
|
#ifdef LOCK_PROFILING
|
||||||
doing_lockprof = 1;
|
doing_lockprof = 1;
|
||||||
state = v;
|
state = v;
|
||||||
@ -460,11 +466,6 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v,
|
|||||||
#ifdef KDTRACE_HOOKS
|
#ifdef KDTRACE_HOOKS
|
||||||
lda.spin_cnt++;
|
lda.spin_cnt++;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HWPMC_HOOKS
|
|
||||||
PMC_SOFT_CALL( , , lock, failed);
|
|
||||||
#endif
|
|
||||||
lock_profile_obtain_lock_failed(&rw->lock_object,
|
|
||||||
&contested, &waittime);
|
|
||||||
|
|
||||||
#ifdef ADAPTIVE_RWLOCKS
|
#ifdef ADAPTIVE_RWLOCKS
|
||||||
/*
|
/*
|
||||||
@ -890,6 +891,12 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid,
|
|||||||
CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__,
|
CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__,
|
||||||
rw->lock_object.lo_name, (void *)rw->rw_lock, file, line);
|
rw->lock_object.lo_name, (void *)rw->rw_lock, file, line);
|
||||||
|
|
||||||
|
#ifdef HWPMC_HOOKS
|
||||||
|
PMC_SOFT_CALL( , , lock, failed);
|
||||||
|
#endif
|
||||||
|
lock_profile_obtain_lock_failed(&rw->lock_object,
|
||||||
|
&contested, &waittime);
|
||||||
|
|
||||||
#ifdef LOCK_PROFILING
|
#ifdef LOCK_PROFILING
|
||||||
doing_lockprof = 1;
|
doing_lockprof = 1;
|
||||||
state = v;
|
state = v;
|
||||||
@ -910,11 +917,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid,
|
|||||||
#ifdef KDTRACE_HOOKS
|
#ifdef KDTRACE_HOOKS
|
||||||
lda.spin_cnt++;
|
lda.spin_cnt++;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HWPMC_HOOKS
|
|
||||||
PMC_SOFT_CALL( , , lock, failed);
|
|
||||||
#endif
|
|
||||||
lock_profile_obtain_lock_failed(&rw->lock_object,
|
|
||||||
&contested, &waittime);
|
|
||||||
#ifdef ADAPTIVE_RWLOCKS
|
#ifdef ADAPTIVE_RWLOCKS
|
||||||
/*
|
/*
|
||||||
* If the lock is write locked and the owner is
|
* If the lock is write locked and the owner is
|
||||||
|
@ -551,6 +551,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts,
|
|||||||
CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__,
|
CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__,
|
||||||
sx->lock_object.lo_name, (void *)sx->sx_lock, file, line);
|
sx->lock_object.lo_name, (void *)sx->sx_lock, file, line);
|
||||||
|
|
||||||
|
#ifdef HWPMC_HOOKS
|
||||||
|
PMC_SOFT_CALL( , , lock, failed);
|
||||||
|
#endif
|
||||||
|
lock_profile_obtain_lock_failed(&sx->lock_object, &contested,
|
||||||
|
&waittime);
|
||||||
|
|
||||||
#ifdef LOCK_PROFILING
|
#ifdef LOCK_PROFILING
|
||||||
extra_work = 1;
|
extra_work = 1;
|
||||||
state = x;
|
state = x;
|
||||||
@ -571,11 +577,6 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts,
|
|||||||
#ifdef KDTRACE_HOOKS
|
#ifdef KDTRACE_HOOKS
|
||||||
lda.spin_cnt++;
|
lda.spin_cnt++;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HWPMC_HOOKS
|
|
||||||
PMC_SOFT_CALL( , , lock, failed);
|
|
||||||
#endif
|
|
||||||
lock_profile_obtain_lock_failed(&sx->lock_object, &contested,
|
|
||||||
&waittime);
|
|
||||||
#ifdef ADAPTIVE_SX
|
#ifdef ADAPTIVE_SX
|
||||||
/*
|
/*
|
||||||
* If the lock is write locked and the owner is
|
* If the lock is write locked and the owner is
|
||||||
@ -889,6 +890,12 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x)
|
|||||||
lock_delay_arg_init(&lda, NULL);
|
lock_delay_arg_init(&lda, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HWPMC_HOOKS
|
||||||
|
PMC_SOFT_CALL( , , lock, failed);
|
||||||
|
#endif
|
||||||
|
lock_profile_obtain_lock_failed(&sx->lock_object, &contested,
|
||||||
|
&waittime);
|
||||||
|
|
||||||
#ifdef LOCK_PROFILING
|
#ifdef LOCK_PROFILING
|
||||||
extra_work = 1;
|
extra_work = 1;
|
||||||
state = x;
|
state = x;
|
||||||
@ -911,12 +918,6 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x)
|
|||||||
lda.spin_cnt++;
|
lda.spin_cnt++;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HWPMC_HOOKS
|
|
||||||
PMC_SOFT_CALL( , , lock, failed);
|
|
||||||
#endif
|
|
||||||
lock_profile_obtain_lock_failed(&sx->lock_object, &contested,
|
|
||||||
&waittime);
|
|
||||||
|
|
||||||
#ifdef ADAPTIVE_SX
|
#ifdef ADAPTIVE_SX
|
||||||
/*
|
/*
|
||||||
* If the owner is running on another CPU, spin until
|
* If the owner is running on another CPU, spin until
|
||||||
|
Loading…
Reference in New Issue
Block a user